claude-harness/docs/superpowers/plans/2026-10-24-dsh-decouple.md

63 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# DSH decouple from ~/.claude — план
Ветка: `feat/37-dsh-decouple` (issue #37).
Спека/дизайн: `dsh/PORT.md`.
## Цель
Сделать DSH-порт независимым от установки Claude Code: superpowers skills и
роли лежат в `~/.dsh`, а `~/.claude` используется только как fallback.
## Scope
1. `dsh/install.sh`: копировать skills (не symlink), добавить `--roles`,
включить роли в `--all`.
2. `dsh/bundle/index.js`: `resolveRolesDir` — `~/.dsh/roles` → `~/.claude/roles`
→ repo `roles/`.
3. `dsh/bundle/lib/bootstrap.js`: `~/.dsh/skills` раньше кэша `~/.claude`.
4. Тесты: install-копирование, приоритет ролей, приоритет bootstrap.
5. README/PORT: новый порядок установки и fallback.
## Non-goals
- Проектные роли `<cwd>/.dsh/roles` — отдельная задача.
- Vendor superpowers в репозиторий; пока копируем из установленного кэша.
- OpenSpec, SDD, briefing.
## Задачи
- [x] **Task 1: install.sh копирует skills и роли**
- Files: `dsh/install.sh`
- `--skills`: `rm -rf` dest + `cp -R` source, не `ln -sfn`.
- `--roles`: `cp` `$ROOT/roles/*.md` в `$DSH_HOME/roles`.
- `--all` включает `--roles`.
- Проверка: `bash dsh/install.sh --skills --roles` с temp `DSH_HOME`.
- [x] **Task 2: приоритет ~/.dsh/roles**
- Files: `dsh/bundle/index.js`, `dsh/bundle/lib/role.js`
- `resolveRolesDir(bundleDir, configured, home)`: `~/.dsh/roles` →
`~/.claude/roles` → repo.
- `role.js` default `rolesDir` = `~/.dsh/roles`.
- Проверка: unit-тест с temp home, где оба каталога существуют.
- [x] **Task 3: приоритет ~/.dsh/skills**
- Files: `dsh/bundle/lib/bootstrap.js`
- `superpowersCandidates`: env → `~/.dsh/skills` → `~/.agents/skills` →
`~/.claude` cache → `~/.claude/skills`.
- Проверка: unit-тест с temp home, где есть и `.dsh`, и `.claude` cache.
- [x] **Task 4: тест install.sh**
- Files: `dsh/tests/install.test.mjs`
- Fake superpowers cache в temp `HOME`; запуск `--skills --roles`;
проверка, что skill — real directory, роли скопированы; повторный запуск.
- [x] **Task 5: документация**
- Files: `dsh/README.md`, `dsh/PORT.md`
- `--roles`, копирование, fallback.
- [x] **Task 6: прогон и коммит**
- `bash dsh/tests/run.sh` — все тесты.
- `bash tests/run.sh` — регрессий нет.
- Commit, push, PR.
## Acceptance
- В temp `HOME` с только `~/.dsh` bootstrap и `/role dev` работают.
- `bash dsh/tests/run.sh` зелёный.
- `dsh/install.sh --all` создаёт real copies, не symlinks.