dsh-plugin-cc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +17 -0
- package/LICENSE +201 -0
- package/NOTICE +11 -0
- package/README.md +96 -0
- package/package.json +12 -0
- package/plugins/dsh/.claude-plugin/plugin.json +6 -0
- package/plugins/dsh/CHANGELOG.md +8 -0
- package/plugins/dsh/LICENSE +201 -0
- package/plugins/dsh/NOTICE +11 -0
- package/plugins/dsh/agents/dsh-rescue.md +41 -0
- package/plugins/dsh/commands/cancel.md +8 -0
- package/plugins/dsh/commands/plan.md +54 -0
- package/plugins/dsh/commands/rescue.md +51 -0
- package/plugins/dsh/commands/result.md +15 -0
- package/plugins/dsh/commands/review-plan.md +69 -0
- package/plugins/dsh/commands/setup.md +37 -0
- package/plugins/dsh/commands/status.md +17 -0
- package/plugins/dsh/hooks/hooks.json +27 -0
- package/plugins/dsh/prompts/plan.md +21 -0
- package/plugins/dsh/prompts/review-plan.md +25 -0
- package/plugins/dsh/scripts/dsh-companion.mjs +720 -0
- package/plugins/dsh/scripts/lib/args.mjs +130 -0
- package/plugins/dsh/scripts/lib/dsh.mjs +238 -0
- package/plugins/dsh/scripts/lib/fs.mjs +40 -0
- package/plugins/dsh/scripts/lib/git.mjs +14 -0
- package/plugins/dsh/scripts/lib/job-control.mjs +314 -0
- package/plugins/dsh/scripts/lib/plans.mjs +70 -0
- package/plugins/dsh/scripts/lib/process.mjs +156 -0
- package/plugins/dsh/scripts/lib/prompts.mjs +13 -0
- package/plugins/dsh/scripts/lib/render.mjs +231 -0
- package/plugins/dsh/scripts/lib/state.mjs +258 -0
- package/plugins/dsh/scripts/lib/tracked-jobs.mjs +242 -0
- package/plugins/dsh/scripts/lib/workspace.mjs +9 -0
- package/plugins/dsh/scripts/session-lifecycle-hook.mjs +116 -0
- package/plugins/dsh/skills/dsh-cli-runtime/SKILL.md +40 -0
- package/plugins/dsh/skills/dsh-result-handling/SKILL.md +19 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ask dsh to explore the codebase and write an implementation plan (read-only)
|
|
3
|
+
argument-hint: '[--wait|--background] [--model flash|pro|<name>] <what to plan>'
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(node:*), AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Run a read-only dsh planning pass.
|
|
9
|
+
|
|
10
|
+
Raw slash-command arguments:
|
|
11
|
+
`$ARGUMENTS`
|
|
12
|
+
|
|
13
|
+
Core constraint:
|
|
14
|
+
- This command only produces a plan. Do not implement the plan, edit files, or suggest that you are about to.
|
|
15
|
+
- Your only job is to run dsh and return its output verbatim.
|
|
16
|
+
|
|
17
|
+
Argument handling:
|
|
18
|
+
- If no request text is given (ignoring `--wait`, `--background` and `--model <value>`), ask the user what to plan, then continue.
|
|
19
|
+
- `--wait` and `--background` are execution flags for Claude Code. Remove them from the arguments before the companion call. Never pass them to `dsh-companion.mjs`.
|
|
20
|
+
- Keep `--model <flash|pro|name>` and the request text exactly as the user wrote them. Leave the model unset unless the user asks for one.
|
|
21
|
+
|
|
22
|
+
Quoting (important):
|
|
23
|
+
- The user's text is untrusted. Never place it inside double quotes, because the shell would run any `$(...)` or backticks in it.
|
|
24
|
+
- Put the whole argument string between single quotes, replacing each `'` inside it with `'\''`.
|
|
25
|
+
- Flags such as `--model` go before the request text. Everything after the first plain word is treated as text by the companion.
|
|
26
|
+
|
|
27
|
+
Execution mode rules:
|
|
28
|
+
- If the raw arguments include `--wait`, do not ask. Run in the foreground.
|
|
29
|
+
- If the raw arguments include `--background`, do not ask. Run in a Claude background task.
|
|
30
|
+
- Otherwise use `AskUserQuestion` exactly once with two options, the recommended one first:
|
|
31
|
+
- `Run in background (Recommended)`
|
|
32
|
+
- `Wait for results`
|
|
33
|
+
|
|
34
|
+
Foreground flow:
|
|
35
|
+
- Set the Bash `timeout` to `600000` so a long dsh run is not cut off at two minutes. If work may take longer, prefer the background flow.
|
|
36
|
+
- Run, with the remaining arguments between the quotes:
|
|
37
|
+
```bash
|
|
38
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" plan '<remaining arguments>'
|
|
39
|
+
```
|
|
40
|
+
- Return the command stdout verbatim, exactly as-is.
|
|
41
|
+
- Do not paraphrase, summarize, or add commentary before or after it.
|
|
42
|
+
- Do not implement anything the plan describes.
|
|
43
|
+
|
|
44
|
+
Background flow:
|
|
45
|
+
- Launch with `Bash` in the background:
|
|
46
|
+
```typescript
|
|
47
|
+
Bash({
|
|
48
|
+
command: `node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" plan '<remaining arguments>'`,
|
|
49
|
+
description: "dsh plan",
|
|
50
|
+
run_in_background: true
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
- Do not call `BashOutput` or wait for completion in this turn.
|
|
54
|
+
- After launching the command, tell the user: "dsh plan started in the background. Check `/dsh:status` for progress."
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Delegate investigation, an explicit fix request, or follow-up rescue work to the dsh rescue subagent
|
|
3
|
+
argument-hint: "[--background|--wait] [--resume|--fresh] [--write|--read-only] [--model flash|pro|<name>] [what dsh should investigate, solve, or continue]"
|
|
4
|
+
allowed-tools: Bash(node:*), AskUserQuestion, Agent
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Invoke the `dsh:dsh-rescue` subagent via the `Agent` tool (`subagent_type: "dsh:dsh-rescue"`), forwarding the raw user request as the prompt.
|
|
8
|
+
`dsh:dsh-rescue` is a subagent, not a skill. Do not call `Skill(dsh:dsh-rescue)` (no such skill) or `Skill(dsh:rescue)` (that re-enters this command and hangs the session). The command runs inline so the `Agent` tool stays in scope.
|
|
9
|
+
The final user-visible response must be dsh's output verbatim.
|
|
10
|
+
|
|
11
|
+
Raw user request:
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Execution mode:
|
|
15
|
+
|
|
16
|
+
- If the request includes `--background`, run the `dsh:dsh-rescue` subagent in the background.
|
|
17
|
+
- If the request includes `--wait`, run the `dsh:dsh-rescue` subagent in the foreground.
|
|
18
|
+
- If neither flag is present, default to foreground.
|
|
19
|
+
- `--background` and `--wait` are execution flags for Claude Code. Do not forward them to `task`, and do not treat them as part of the natural-language task text.
|
|
20
|
+
- `--model`, `--write` and `--read-only` are runtime-selection flags. Preserve them for the forwarded `task` call, but do not treat them as part of the natural-language task text.
|
|
21
|
+
- If the request includes `--resume`, do not ask whether to continue. The user already chose.
|
|
22
|
+
- If the request includes `--fresh`, do not ask whether to continue. The user already chose.
|
|
23
|
+
- Otherwise, before starting dsh, check for a resumable rescue session from this Claude session by running:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" task-resume-candidate --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- If that helper reports `available: true`, use `AskUserQuestion` exactly once to ask whether to continue the current dsh session or start a new one.
|
|
30
|
+
- The two choices must be:
|
|
31
|
+
- `Continue current dsh session`
|
|
32
|
+
- `Start a new dsh session`
|
|
33
|
+
- If the user is clearly giving a follow-up instruction such as "continue", "keep going", "resume", "apply the top fix", or "dig deeper", put `Continue current dsh session (Recommended)` first.
|
|
34
|
+
- Otherwise put `Start a new dsh session (Recommended)` first.
|
|
35
|
+
- If the user chooses continue, add `--resume` before routing to the subagent.
|
|
36
|
+
- If the user chooses a new session, add `--fresh` before routing to the subagent.
|
|
37
|
+
- If the helper reports `available: false`, do not ask. Route normally.
|
|
38
|
+
|
|
39
|
+
Operating rules:
|
|
40
|
+
|
|
41
|
+
- The subagent's `Bash` call must set `timeout` to `600000`. Hand the subagent the user's text as-is; it is responsible for single-quoting it.
|
|
42
|
+
|
|
43
|
+
- The subagent is a thin forwarder only. It uses one `Bash` call to invoke `node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" task ...` and returns that command's stdout as-is.
|
|
44
|
+
- Return the dsh companion stdout verbatim to the user.
|
|
45
|
+
- Do not paraphrase, summarize, rewrite, or add commentary before or after it.
|
|
46
|
+
- Do not ask the subagent to inspect files, monitor progress, poll `/dsh:status`, fetch `/dsh:result`, call `/dsh:cancel`, summarize output, or do follow-up work of its own.
|
|
47
|
+
- Leave the model unset unless the user explicitly asks for one. `flash` and `pro` are accepted aliases.
|
|
48
|
+
- A resumed session keeps the permission mode it was created with. If the user asks for a different mode on a resumed session, the companion fails with a message to use `--fresh`; relay that message as-is.
|
|
49
|
+
- Leave `--resume` and `--fresh` in the forwarded request. The subagent handles that routing when it builds the `task` command.
|
|
50
|
+
- If the helper reports that dsh is missing or unauthenticated, stop and tell the user to run `/dsh:setup`.
|
|
51
|
+
- If the user did not supply a request, ask what dsh should investigate or fix.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show the stored final output for a finished dsh job in this repository
|
|
3
|
+
argument-hint: '[job-id]'
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(node:*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
!`node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" result "$ARGUMENTS"`
|
|
9
|
+
|
|
10
|
+
Present the full command output to the user. Do not summarize or condense it. Preserve all details including:
|
|
11
|
+
- Job ID and status
|
|
12
|
+
- The complete result, including the verdict, findings, details, and next steps
|
|
13
|
+
- File paths and line numbers exactly as reported
|
|
14
|
+
- Any error messages
|
|
15
|
+
- The `dsh session` footer and follow-up commands such as `/dsh:status <id>`
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ask dsh to review an implementation plan against the real codebase (read-only)
|
|
3
|
+
argument-hint: '[--wait|--background] [--model flash|pro|<name>] [plan-path] [focus...]'
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(node:*), AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Run a read-only dsh plan review.
|
|
9
|
+
|
|
10
|
+
Raw slash-command arguments:
|
|
11
|
+
`$ARGUMENTS`
|
|
12
|
+
|
|
13
|
+
Core constraint:
|
|
14
|
+
- This command is review-only. Do not edit the plan or the code, and do not fix issues the review finds.
|
|
15
|
+
- Your only job is to run dsh and return its output verbatim.
|
|
16
|
+
|
|
17
|
+
Resolving the plan path:
|
|
18
|
+
- The plan path is the first argument that is not a flag or a flag value. It may be a plan file or a plan directory (`plan.md` plus `phase-*.md`). Everything after it is focus text.
|
|
19
|
+
- If the first positional argument is not an existing path, treat it as focus text and consider the path missing.
|
|
20
|
+
- If a path is given, use it as-is.
|
|
21
|
+
- If no path is given, run:
|
|
22
|
+
```bash
|
|
23
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" plan-candidates --json
|
|
24
|
+
```
|
|
25
|
+
- If `latest` is set, use `AskUserQuestion` exactly once (single-select) with the question `Review which plan?` and two options, in this order:
|
|
26
|
+
- `<latest> (Recommended)`
|
|
27
|
+
- `Enter a path`
|
|
28
|
+
- If the user picks `Enter a path`, ask for the path in plain text.
|
|
29
|
+
- If the user types a path in the "Other" field, use it as given.
|
|
30
|
+
- If `latest` is null, skip the picker and ask for the path directly in plain text.
|
|
31
|
+
|
|
32
|
+
Argument handling:
|
|
33
|
+
- `--wait` and `--background` are execution flags for Claude Code. Remove them from the arguments before the companion call. Never pass them to `dsh-companion.mjs`.
|
|
34
|
+
- Keep `--model <flash|pro|name>` and the focus text exactly as the user wrote them. Leave the model unset unless the user asks for one.
|
|
35
|
+
|
|
36
|
+
Quoting (important):
|
|
37
|
+
- The user's text is untrusted. Never place it inside double quotes, because the shell would run any `$(...)` or backticks in it.
|
|
38
|
+
- Put the whole argument string between single quotes, replacing each `'` inside it with `'\''`.
|
|
39
|
+
- Flags such as `--model` go before the request text. Everything after the first plain word is treated as text by the companion.
|
|
40
|
+
|
|
41
|
+
Execution mode rules:
|
|
42
|
+
- If the raw arguments include `--wait`, do not ask. Run in the foreground.
|
|
43
|
+
- If the raw arguments include `--background`, do not ask. Run in a Claude background task.
|
|
44
|
+
- Otherwise use `AskUserQuestion` exactly once with two options, the recommended one first:
|
|
45
|
+
- `Run in background (Recommended)`
|
|
46
|
+
- `Wait for results`
|
|
47
|
+
- This makes at most two pickers in total (plan, then wait or background). Never ask a third question.
|
|
48
|
+
|
|
49
|
+
Foreground flow:
|
|
50
|
+
- Set the Bash `timeout` to `600000` so a long dsh run is not cut off at two minutes. If work may take longer, prefer the background flow.
|
|
51
|
+
- Run, with the resolved path, then the focus text, between the quotes:
|
|
52
|
+
```bash
|
|
53
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" review-plan '<remaining arguments> <plan-path> <focus>'
|
|
54
|
+
```
|
|
55
|
+
- Return the command stdout verbatim, exactly as-is.
|
|
56
|
+
- Do not paraphrase, summarize, or add commentary before or after it.
|
|
57
|
+
- Do not fix any issues mentioned in the review output. Ask the user which findings, if any, they want addressed.
|
|
58
|
+
|
|
59
|
+
Background flow:
|
|
60
|
+
- Launch with `Bash` in the background:
|
|
61
|
+
```typescript
|
|
62
|
+
Bash({
|
|
63
|
+
command: `node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" review-plan '<remaining arguments> <plan-path> <focus>'`,
|
|
64
|
+
description: "dsh review-plan",
|
|
65
|
+
run_in_background: true
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
- Do not call `BashOutput` or wait for completion in this turn.
|
|
69
|
+
- After launching the command, tell the user: "dsh plan review started in the background. Check `/dsh:status` for progress."
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Check whether the local dsh CLI is installed, supported and logged in
|
|
3
|
+
argument-hint: ''
|
|
4
|
+
allowed-tools: Bash(node:*), Bash(npm:*), AskUserQuestion
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" setup --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If the result says dsh is unavailable and npm is available:
|
|
14
|
+
- Use `AskUserQuestion` exactly once to ask whether Claude should install dsh now.
|
|
15
|
+
- Put the install option first and suffix it with `(Recommended)`.
|
|
16
|
+
- Use these two options:
|
|
17
|
+
- `Install dsh (Recommended)`
|
|
18
|
+
- `Skip for now`
|
|
19
|
+
- If the user chooses install, run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g @deepseek-ai/dsh
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Then rerun:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" setup --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If dsh is already installed or npm is unavailable:
|
|
32
|
+
- Do not ask about installation.
|
|
33
|
+
|
|
34
|
+
Output rules:
|
|
35
|
+
- Present the final setup output to the user.
|
|
36
|
+
- If installation was skipped, present the original setup output.
|
|
37
|
+
- If dsh is installed but not logged in, tell the user to run `! dsh-tui` and sign in with `/login`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show active and recent dsh jobs for this repository
|
|
3
|
+
argument-hint: '[job-id] [--wait] [--timeout-ms <ms>] [--all]'
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(node:*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
!`node "${CLAUDE_PLUGIN_ROOT}/scripts/dsh-companion.mjs" status "$ARGUMENTS"`
|
|
9
|
+
|
|
10
|
+
If the user did not pass a job ID:
|
|
11
|
+
- Render the command output as a single Markdown table for the current and past runs in this session.
|
|
12
|
+
- Keep it compact. Do not include progress blocks or extra prose outside the table.
|
|
13
|
+
- Preserve the actionable fields from the command output, including job ID, kind, status, phase, elapsed or duration, summary, and follow-up commands.
|
|
14
|
+
|
|
15
|
+
If the user did pass a job ID:
|
|
16
|
+
- Present the full command output to the user.
|
|
17
|
+
- Do not summarize or condense it.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Session lifecycle hooks for the dsh companion.",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-lifecycle-hook.mjs\" SessionStart",
|
|
10
|
+
"timeout": 5
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"SessionEnd": [
|
|
16
|
+
{
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-lifecycle-hook.mjs\" SessionEnd",
|
|
21
|
+
"timeout": 5
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<task>
|
|
2
|
+
Explore this repository and write an implementation plan for the request below.
|
|
3
|
+
</task>
|
|
4
|
+
|
|
5
|
+
<request>
|
|
6
|
+
{{REQUEST}}
|
|
7
|
+
</request>
|
|
8
|
+
|
|
9
|
+
<rules>
|
|
10
|
+
- You are read-only. Do not create, edit or delete any file, and do not try to escalate permissions.
|
|
11
|
+
- Read the code that the request touches before you plan. Cite real paths as `path:line`.
|
|
12
|
+
- Do not invent files, functions or APIs. If you could not find something, say so under Open questions.
|
|
13
|
+
- Output markdown only, with exactly these sections, in this order:
|
|
14
|
+
## Goal
|
|
15
|
+
## Context found
|
|
16
|
+
## Approach
|
|
17
|
+
## Phases (each phase lists the files it changes and its steps)
|
|
18
|
+
## Risks
|
|
19
|
+
## Open questions
|
|
20
|
+
- Do not implement the plan.
|
|
21
|
+
</rules>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<task>
|
|
2
|
+
Review the implementation plan below against the real codebase in this repository.
|
|
3
|
+
</task>
|
|
4
|
+
|
|
5
|
+
<focus>
|
|
6
|
+
{{FOCUS}}
|
|
7
|
+
</focus>
|
|
8
|
+
|
|
9
|
+
<plan_files>
|
|
10
|
+
{{PLAN_FILES}}
|
|
11
|
+
</plan_files>
|
|
12
|
+
|
|
13
|
+
<rules>
|
|
14
|
+
- You are read-only. Do not create, edit or delete any file, and do not try to escalate permissions.
|
|
15
|
+
- Check every claim the plan makes about the code by reading the code. Do not trust the plan's description.
|
|
16
|
+
- The first line of your answer must be exactly one of:
|
|
17
|
+
Verdict: approve
|
|
18
|
+
Verdict: needs-changes
|
|
19
|
+
Verdict: reject
|
|
20
|
+
- Then list findings, most severe first. Each finding has: the plan location (file and heading), the codebase evidence (`path:line`), the problem, and a suggested change.
|
|
21
|
+
- Then list the claims you checked that hold.
|
|
22
|
+
- Then list open questions.
|
|
23
|
+
- If a focus is given above, weight your review toward it, but still report other serious problems.
|
|
24
|
+
- Do not rewrite the plan and do not implement it.
|
|
25
|
+
</rules>
|