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.
Step 1: Bundle skill data in the package
Create desloppify/data/global/ with __init__.py and skill 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 (overlay)
desloppify/data/global/CURSOR.md — copy of docs/CURSOR.md (overlay)
desloppify/data/global/CODEX.md — copy of docs/CODEX.md (overlay)
desloppify/data/global/AGENTS_LOCAL.md — template for --local mode
Update pyproject.toml to include the new package data:
{"flags":[{"id":"setup_global_install_not_discoverable","concern":"Step 4 only teaches about global installs, but the scan workflow still checks for installed skills via only. That means a user who ran can still get during , because the scan path remains blind to the global install.","category":"correctness","severity_hint":"likely-significant","evidence":" still defines/install-detects only project-root paths via ; does a post-check with and prints the missing-skill guidance when that returns ."},{"id":"setup_global_paths_not_repo_validated","concern":"The plan treats and as confirmed global discovery roots, but the repository itself does not establish that. Every existing path in the codebase is project-relative, not home-relative. Against the actual repo, the core premise of the new command still depends on an assumption that is not validated anywhere in-tree.","category":"correctness","severity_hint":"likely-significant","evidence":" defines and as paths relative to the project; resolves targets under ; documents as the existing install path and does not mention any home-directory install mechanism."},{"id":"setup_parser_wiring_incomplete","concern":"The parser-layer gap is still present. Step 3 updates , , and , but imports subcommand builders from , not directly from . Unless the plan also updates the re-export layer or changes the import path, the new parser hook is incomplete.","category":"completeness","severity_hint":"likely-minor","evidence":" imports helpers from ; is the current re-export surface and does not yet include ."}],"verified_flag_ids":["setup_codex_target_unresolved","setup_local_mode_uses_cwd_not_project_root","setup_local_template_drops_existing_agents_overlays"],"disputed_flag_ids":[]}
User
Assistant
Step 2: Create the setup command module
Create desloppify/app/commands/setup/__init__.py and desloppify/app/commands/setup/cmd.py.
Global mode (default: desloppify setup)
For each target interface, install the bundled skill to the user's home directory:
Interface
Global path
Overlay
claude
~/.claude/skills/desloppify/SKILL.md
CLAUDE.md
codex
~/.codex/skills/desloppify/SKILL.md
CODEX.md
cursor
~/.cursor/rules/desloppify.md
CURSOR.md
Logic:
Read bundled files via importlib.resources.files('desloppify.data.global')
For each target: assemble base SKILL.md + interface overlay (reuse _build_section pattern from update_skill)
Create parent directories (mkdir -p equivalent)
Write file (use safe_write_text from base)
Print summary of what was installed
Support --interface flag to install only one target.
Local mode (desloppify setup --local)
Read bundled AGENTS_LOCAL.md template
Write to ./AGENTS.md in the current working directory
If AGENTS.md already exists, use section markers (<!-- desloppify-begin/end -->) to replace only the desloppify section (reuse _replace_section from update_skill)
parser_groups_admin.py — add _add_setup_parser(sub) with --local and --interface args.
parser.py — import and call _add_setup_parser(sub).
registry.py — add "setup": cmd_setup to the handlers dict.
Step 4: Create the AGENTS_LOCAL.md template
A minimal local template with begin/end markers, skill version marker, and the core workflow instructions. Enough for agents to use desloppify without needing the global skill installed.
Step 5: Tests
Create desloppify/tests/commands/test_setup.py:
Test global install creates files in a temp dir (mock Path.home())
Test --local creates AGENTS.md in cwd
Test --local with existing AGENTS.md does section replacement
Test --interface flag installs only one target
Test bundled resources are readable via importlib.resources
Step 6: Sync guard
Add a test that compares docs/SKILL.md with desloppify/data/global/SKILL.md to catch drift between source-of-truth docs and bundled copies.
File change summary
File
Action
desloppify/data/__init__.py
Create (empty)
desloppify/data/global/__init__.py
Create (empty)
desloppify/data/global/SKILL.md
Create (copy from docs/)
desloppify/data/global/CLAUDE.md
Create (copy from docs/)
desloppify/data/global/CURSOR.md
Create (copy from docs/)
desloppify/data/global/CODEX.md
Create (copy from docs/)
desloppify/data/global/AGENTS_LOCAL.md
Create (new template)
desloppify/app/commands/setup/__init__.py
Create
desloppify/app/commands/setup/cmd.py
Create
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
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-20T17:23:12Z",
"hash": "sha256:3f410ee081304941f2d444e1f352da1dc60637619161159d3f210125402cf238",
"questions": [
"Which overlays to bundle for global install? The idea mentions claude/codex/cursor. Should we also bundle AMP, OpenCode, Droid, etc.? More overlays = larger package but more universal. Recommend starting with claude + codex + cursor and adding others on demand.",
"Sync strategy for bundled data vs docs/: Should we (a) copy-on-release manually, (b) have a test that fails if they drift, (c) read docs/ at runtime when available and fall back to bundled? Option (b) is cheapest and safest.",
"What should AGENTS_LOCAL.md contain? Full SKILL.md content (verbose but complete), or a minimal pointer telling agents desloppify is available? Full content gives agents everything; a pointer is lighter but assumes the global skill is also installed.",
"Should setup also handle ~/.codex/skills/? Codex may not have a global skill directory \u2014 SKILL_TARGETS shows codex uses .agents/skills/ (project-relative). Need to verify the actual Codex global skill discovery path.",
"Relationship to update-skill: Should setup eventually replace update-skill for global installs, or coexist permanently? setup=bundled/offline/global vs update-skill=network/latest/per-project seems like a clean split."
],
"success_criteria": [
"pip install desloppify && desloppify setup installs skill files to ~/.claude/skills/desloppify/SKILL.md, ~/.codex/skills/desloppify/SKILL.md, and ~/.cursor/rules/desloppify.md \u2014 all readable and containing the correct skill version marker.",
"desloppify setup --local creates or updates ./AGENTS.md with desloppify skill content wrapped in begin/end markers.",
"desloppify setup --local on an existing AGENTS.md with other content preserves that content and only replaces the desloppify section.",
"desloppify setup --interface claude installs only the Claude target.",
"All operations work offline (no network calls) \u2014 files come from importlib.resources bundled data.",
"python -m pytest desloppify/tests/commands/test_setup.py -q passes with tests covering global install, local install, section replacement, and single-interface modes.",
"desloppify setup prints a clear summary of what was installed and where."
],
"assumptions": [
"Global skill directories exist for each target. Claude Code uses ~/.claude/skills/ for global skills. Codex and Cursor global skill paths are assumed from the idea description \u2014 these need verification.",
"importlib.resources.files() works for the bundled .md files when the package is installed via pip (including editable installs). This is standard Python 3.11+ behavior with include-package-data=false + explicit package-data entries.",
"The bundled skill files are a snapshot \u2014 they match the version shipped with that release. Users wanting the latest should use update-skill (which downloads from GitHub). This is the intended design.",
"No network access is needed or desired for setup. This is the key differentiator from update-skill.",
"The docs/ directory is the source of truth. Bundled data in desloppify/data/global/ is a copy that must be kept in sync, either manually or via CI/test guardrails.",
"Section markers (desloppify-begin/end) are the established pattern for shared-file installations and will be reused for --local AGENTS.md."
]
}
code
Existing flags:
[]
Requirements:
- Reuse existing flag IDs when the same concern is still open.
- verified_flag_ids should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Do not rubber-stamp the plan.
- Assign severity_hint carefully: "likely-significant" for issues that would
cause real product or implementation problems. "likely-minor" for cosmetic,
nice-to-have, or issues already covered elsewhere.
{"flags":[{"id":"setup_global_install_not_discoverable","concern":"The plan adds home-directory installs, but it does not update the repository’s existing skill discovery/version-check/auto-update path. Today find_installed_skill() only scans paths under the project root, and _try_auto_update_skill() depends on that result. As written, desloppify setup could successfully write ~/.claude/... or ~/.cursor/... files that the tool itself never sees as installed or stale.","category":"correctness","severity_hint":"likely-significant","evidence":"desloppify/app/skill_docs.py:20-29 defines SKILL_SEARCH_PATHS as project-relative paths only; desloppify/app/skill_docs.py:59-83 joins them against get_project_root(); desloppify/app/skill_docs.py:86-95 uses that for stale-version warnings; desloppify/app/commands/scan/reporting/agent_context.py:242-260 calls find_installed_skill() before deciding whether to auto-update."},{"id":"setup_codex_target_unresolved","concern":"The plan hardcodes Codex global install success around ~/.codex/skills/desloppify/SKILL.md, but the current repository’s canonical target map still treats Codex as .agents/skills/desloppify/SKILL.md. There is also a conflicting runtime hint that mentions ~/.codex/skills. That inconsistency needs to be resolved first; otherwise setup, update-skill, docs, and diagnostics will disagree about where Codex skills belong.","category":"correctness","severity_hint":"likely-significant","evidence":"desloppify/app/skill_docs.py:34-45 maps codex to .agents/skills/desloppify/SKILL.md; README.md:25-26 points users to desloppify update-skill ... and lists codex among the existing interface options; desloppify/app/commands/review/runner_failures.py:178-184 separately tells users to inspect ~/.codex/skills, showing the repo is currently split on Codex path semantics."},{"id":"setup_local_mode_uses_cwd_not_project_root","concern":"The plan says desloppify setup --local should write ./AGENTS.md in the current working directory. That diverges from the repository’s current install semantics, which always resolve targets relative to the detected project root. If a user runs the command from a subdirectory, the new file would land in the wrong place and existing discovery logic would miss it.","category":"correctness","severity_hint":"likely-significant","evidence":"desloppify/app/commands/update_skill/cmd.py:172-200 builds the target path as get_project_root() / target_rel; desloppify/app/skill_docs.py:20-29 and desloppify/app/skill_docs.py:59-63 only search for AGENTS.md at the project root, not in arbitrary working directories."},{"id":"setup_local_template_drops_existing_agents_overlays","concern":"The plan introduces a new minimal AGENTS_LOCAL.md template, but the repository already treats AGENTS.md as a shared install target for multiple interfaces with distinct overlays (windsurf, gemini, hermes). Replacing that with a generic minimal template would drop interface-specific instructions that the repo currently considers part of the supported workflow.","category":"completeness","severity_hint":"likely-significant","evidence":"desloppify/app/skill_docs.py:43-45 maps AGENTS.md to WINDSURF, GEMINI, and HERMES; docs/HERMES.md:1-40 contains substantial Hermes-specific review/import behavior that a minimal generic template would not preserve."},{"id":"setup_parser_wiring_incomplete","concern":"Step 3 does not account for the parser re-export layer the repo already uses. parser.py imports command builders from desloppify.app.cli_support.parser_groups, not directly from parser_groups_admin.py. Following the plan literally leaves out either a required parser_groups.py re-export or an explicit import-path change.","category":"completeness","severity_hint":"likely-minor","evidence":"desloppify/app/cli_support/parser.py:9-29 imports _add_*_parser functions from parser_groups; desloppify/app/cli_support/parser_groups.py:7-18 re-exports the admin parser builders and :25-46 exposes them in __all__. The plan only mentions parser_groups_admin.py, parser.py, and registry.py."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
You are an independent reviewer. Critique the plan against the actual repository.
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 ~/.claude/skills/, ~/.cursor/rules/, etc. Desloppify's own find_installed_skill() currently only checks project-relative paths — it detects the per-project install, not the global one. The plan addresses this gap (see Step 6).
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 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:
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 as a troubleshooting hint — these are inconsistent. Rather than guess, we skip codex global install until the correct global discovery path is confirmed. 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."
Global mode (default: desloppify setup)
Logic:
Read bundled files via importlib.resources.files('desloppify.data.global')
For each target in GLOBAL_TARGETS: assemble base SKILL.md + interface overlay (reuse _build_section from update_skill)
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. The valid choices for --local are: windsurf, gemini, hermes.
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
These are already tested and stable. No refactoring needed.
Step 3: 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:
python
from desloppify.app.commands.setup import cmd_setup
# ...
"setup": cmd_setup,
Step 4: Extend skill discovery to check global paths
Addresses the discoverability gap. Currently find_installed_skill() only searches project-relative paths. After setup writes files to ~/, desloppify should be able to detect them for version-check and staleness warnings.
Add a find_global_skill() function that searches Path.home() / path for each entry, returning a SkillInstall if found.
Modify 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"
Do NOT change the auto-update path (_try_auto_update_skill). Auto-update should remain project-scoped (it downloads from GitHub). Global installs are updated explicitly via desloppify setup.
Step 5: Tests
Create desloppify/tests/commands/test_setup.py:
Global install: mock Path.home() to a temp dir, 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
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
Step 6: 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/"
File change summary
File
Action
desloppify/data/__init__.py
Create (empty)
desloppify/data/global/__init__.py
Create (empty)
desloppify/data/global/SKILL.md
Create (copy from docs/)
desloppify/data/global/CLAUDE.md
Create (copy from docs/)
desloppify/data/global/CURSOR.md
Create (copy from docs/)
desloppify/data/global/CODEX.md
Create (copy from docs/)
desloppify/data/global/WINDSURF.md
Create (copy from docs/)
desloppify/data/global/GEMINI.md
Create (copy from docs/)
desloppify/data/global/HERMES.md
Create (copy from docs/)
desloppify/app/commands/setup/__init__.py
Create
desloppify/app/commands/setup/cmd.py
Create
desloppify/app/skill_docs.py
Edit (add global search paths + find_global_skill())
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": 2,
"timestamp": "2026-03-20T17:29:17Z",
"hash": "sha256:14ce6942b3096d046085b66852f6342cacd2e1bf38a1526a1469aa4870bfcf99",
"changes_summary": "Addressed all 4 significant flags: (1) Added Step 4 to extend skill discovery with find_global_skill() and update check_skill_version() so globally-installed skills are detectable for staleness warnings \u2014 without touching the auto-update path. (2) Excluded Codex from global targets with a clear skip message, since the codebase disagrees on Codex's global path (.agents/skills/ vs ~/.codex/skills). (3) Changed --local to use get_project_root() instead of cwd, matching the rest of the codebase. (4) Made --local require --interface since AGENTS.md is shared by windsurf/gemini/hermes with distinct overlays; bundled all overlays so the correct one can be assembled.",
"flags_addressed": [
"setup_global_install_not_discoverable",
"setup_codex_target_unresolved",
"setup_local_mode_uses_cwd_not_project_root",
"setup_local_template_drops_existing_agents_overlays"
],
"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.",
"Should find_global_skill() results feed into the scan output's stale-skill warning, or only into check_skill_version()? Currently leaning toward check_skill_version() only, keeping scan's auto-update project-scoped.",
"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 --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.",
"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."
],
"assumptions": [
"Global skill directories: Claude Code uses ~/.claude/skills/ for global skills, Cursor uses ~/.cursor/rules/. These are confirmed by existing codebase patterns.",
"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."
],
"delta_from_previous_percent": 61.56
}
code
Existing flags:
[
{
"id": "setup_global_install_not_discoverable",
"concern": "The plan adds home-directory installs, but it does not update the repository\u2019s existing skill discovery/version-check/auto-update path. Today find_installed_skill() only scans paths under the project root, and _try_auto_update_skill() depends on that result. As written, desloppify setup could successfully write ~/.claude/... or ~/.cursor/... files that the tool itself never sees as installed or stale.",
"status": "addressed",
"severity": "significant"
},
{
"id": "setup_codex_target_unresolved",
"concern": "The plan hardcodes Codex global install success around ~/.codex/skills/desloppify/SKILL.md, but the current repository\u2019s canonical target map still treats Codex as .agents/skills/desloppify/SKILL.md. There is also a conflicting runtime hint that mentions ~/.codex/skills. That inconsistency needs to be resolved first; otherwise setup, update-skill, docs, and diagnostics will disagree about where Codex skills belong.",
"status": "addressed",
"severity": "significant"
},
{
"id": "setup_local_mode_uses_cwd_not_project_root",
"concern": "The plan says desloppify setup --local should write ./AGENTS.md in the current working directory. That diverges from the repository\u2019s current install semantics, which always resolve targets relative to the detected project root. If a user runs the command from a subdirectory, the new file would land in the wrong place and existing discovery logic would miss it.",
"status": "addressed",
"severity": "significant"
},
{
"id": "setup_local_template_drops_existing_agents_overlays",
"concern": "The plan introduces a new minimal AGENTS_LOCAL.md template, but the repository already treats AGENTS.md as a shared install target for multiple interfaces with distinct overlays (windsurf, gemini, hermes). Replacing that with a generic minimal template would drop interface-specific instructions that the repo currently considers part of the supported workflow.",
"status": "addressed",
"severity": "significant"
},
{
"id": "setup_parser_wiring_incomplete",
"concern": "Step 3 does not account for the parser re-export layer the repo already uses. parser.py imports command builders from desloppify.app.cli_support.parser_groups, not directly from parser_groups_admin.py. Following the plan literally leaves out either a required parser_groups.py re-export or an explicit import-path change.",
"status": "open",
"severity": "minor"
}
]
code
Requirements:
- Reuse existing flag IDs when the same concern is still open.
- verified_flag_ids should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Do not rubber-stamp the plan.
- Assign severity_hint carefully: "likely-significant" for issues that would
cause real product or implementation problems. "likely-minor" for cosmetic,
nice-to-have, or issues already covered elsewhere.
check_skill_version()
find_installed_skill()
desloppify setup
No skill document found... desloppify update-skill
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 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
Existing flags:
[
{
"id": "setup_global_install_not_discoverable",
"concern": "Step 4 only teaches check_skill_version() about global installs, but the scan workflow still checks for installed skills via find_installed_skill() only. That means a user who ran desloppify setup can still get No skill document found... desloppify update-skill during scan, because the scan path remains blind to the global install.",
"status": "addressed",
"severity": "significant"
},
{
"id": "setup_parser_wiring_incomplete",
"concern": "The parser-layer gap is still present. Step 3 updates parser_groups_admin.py, parser.py, and registry.py, but parser.py imports subcommand builders from desloppify.app.cli_support.parser_groups, not directly from parser_groups_admin.py. Unless the plan also updates the re-export layer or changes the import path, the new parser hook is incomplete.",
"status": "open",
"severity": "minor"
},
{
"id": "setup_global_paths_not_repo_validated",
"concern": "The plan treats ~/.claude/skills/... and ~/.cursor/rules/... as confirmed global discovery roots, but the repository itself does not establish that. Every existing path in the codebase is project-relative, not home-relative. Against the actual repo, the core premise of the new command still depends on an assumption that is not validated anywhere in-tree.",
"status": "addressed",
"severity": "significant"
}
]
code
Requirements:
- Reuse existing flag IDs when the same concern is still open.
- verified_flag_ids should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Do not rubber-stamp the plan.
- Assign severity_hint carefully: "likely-significant" for issues that would
cause real product or implementation problems. "likely-minor" for cosmetic,
nice-to-have, or issues already covered elsewhere.
{"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."},{"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’s 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."},{"id":"setup_parser_wiring_incomplete","concern":"The parser-layer gap is still present. Step 4 updates parser_groups_admin.py, parser.py, and registry.py, but parser.py imports subcommand builders from desloppify.app.cli_support.parser_groups, not directly from parser_groups_admin.py. Unless the plan also updates the re-export layer or changes the import path, the new parser hook is still incomplete.","category":"completeness","severity_hint":"likely-minor","evidence":"desloppify/app/cli_support/parser.py:9-29 imports _add_*_parser helpers from parser_groups; desloppify/app/cli_support/parser_groups.py:7-18,25-46 is the current re-export surface and does not include _add_setup_parser."}],"verified_flag_ids":["setup_codex_target_unresolved","setup_local_mode_uses_cwd_not_project_root","setup_local_template_drops_existing_agents_overlays"],"disputed_flag_ids":[]}