Update /log skill to use transcript backups via Sonnet subagent; add switch-mode
- skills/log/SKILL.md: pre-gathers unprocessed transcript metadata (compact JSON via list-transcripts-here.sh) rather than full content; spawns a Sonnet subagent (not Haiku — gotcha detection requires judgment) to read JSONL backups, write a companion -transcripts.md log, and mark backups processed in tracking.json; adds Agent and Bash(bash|pwd|python3) to allowed-tools - skills/switch-mode/SKILL.md: add previously untracked skill to repo Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
128
skills/switch-mode/SKILL.md
Normal file
128
skills/switch-mode/SKILL.md
Normal file
@@ -0,0 +1,128 @@
|
||||
---
|
||||
name: switch-mode
|
||||
description: >
|
||||
Change engagement mode mid-session. Updates active-mode.env and last-mode so
|
||||
the next session launches in the new mode. Injects the new mode's workflow
|
||||
stance into the current conversation so it takes effect immediately (driver
|
||||
model cannot change without a relaunch).
|
||||
allowed-tools: Read, Write, Glob, Bash(ls *), Bash(cat *)
|
||||
---
|
||||
|
||||
# Switch Mode Skill
|
||||
|
||||
You are helping the user change their engagement mode.
|
||||
|
||||
## Pre-gathered context
|
||||
|
||||
### Available modes
|
||||
!`ls ~/dev/claude/small-scripts/data/claude-profile/modes/`
|
||||
|
||||
### Current active-mode.env
|
||||
!`cat ~/.claude-oreillyit/active-mode.env`
|
||||
|
||||
### Current last-mode
|
||||
!`cat ~/.claude-oreillyit/last-mode`
|
||||
|
||||
## Instructions
|
||||
|
||||
The user wants to switch engagement mode. Follow these steps exactly.
|
||||
|
||||
### Step 1: Build the mode menu
|
||||
|
||||
Read each `.md` file in `/home/paul/dev/claude/small-scripts/data/claude-profile/modes/` using the Read tool.
|
||||
From each file's frontmatter, extract:
|
||||
- `name` — the mode identifier
|
||||
- `tag` — display tag (same as name usually)
|
||||
- `driver` — the driver model
|
||||
- `escalates_to` — escalation model (or "none")
|
||||
|
||||
From the body, read the `## Purpose` section to get a one-line description.
|
||||
|
||||
Present a numbered menu like this (order: quick, deep, hybrid, orch, chat):
|
||||
|
||||
```
|
||||
Available modes:
|
||||
|
||||
1. quick [Sonnet] One small focused job — get in, get out
|
||||
2. deep [Sonnet -> Opus] Hard design/debug, plan-first, spec-driven
|
||||
3. hybrid [Haiku -> Opus] Long sessions, cheap driver, escalate on demand
|
||||
4. orch [Sonnet] Parallel container agents, orchestration focus
|
||||
5. chat [Haiku] No project, just conversation
|
||||
```
|
||||
|
||||
Mark the current mode (from `active-mode.env`'s `CLAUDE_MODE`) with `(current)`.
|
||||
|
||||
If `$ARGUMENTS` is non-empty and matches a mode name, skip the menu and go directly to Step 2 with that mode.
|
||||
|
||||
### Step 2: Confirm selection
|
||||
|
||||
Ask the user which mode number (or name) they want to switch to.
|
||||
Wait for their response. If they already specified a mode in `$ARGUMENTS` or the menu was skipped, confirm it: "Switching to `<name>` mode — confirm? (y/n)"
|
||||
|
||||
### Step 3: Read the target mode file
|
||||
|
||||
Use the Read tool to read the full content of `/home/paul/dev/claude/small-scripts/data/claude-profile/modes/<name>.md`.
|
||||
|
||||
Extract all frontmatter fields:
|
||||
- `name`
|
||||
- `tag`
|
||||
- `driver`
|
||||
- `async_ok`
|
||||
- `autoloop`
|
||||
- `plan_mode_auto`
|
||||
- `spec_driven`
|
||||
- `escalates_to`
|
||||
|
||||
Compute the full mode file path: `/home/paul/dev/claude/small-scripts/data/claude-profile/modes/<name>.md`
|
||||
|
||||
### Step 4: Write active-mode.env
|
||||
|
||||
Write `/home/paul/.claude-oreillyit/active-mode.env` with this exact format (substitute the values from the frontmatter):
|
||||
|
||||
```
|
||||
CLAUDE_MODE=<name>
|
||||
CLAUDE_MODE_TAG=<tag>
|
||||
CLAUDE_DRIVER=<driver>
|
||||
CLAUDE_ESCALATES_TO=<escalates_to>
|
||||
CLAUDE_PROJECT=
|
||||
CLAUDE_TIME_HORIZON=2
|
||||
CLAUDE_ASYNC_OK=<async_ok>
|
||||
CLAUDE_AUTOLOOP=<autoloop>
|
||||
CLAUDE_PLAN_MODE_AUTO=<plan_mode_auto>
|
||||
CLAUDE_SPEC_DRIVEN=<spec_driven>
|
||||
CLAUDE_MODE_FILE=/home/paul/dev/claude/small-scripts/data/claude-profile/modes/<name>.md
|
||||
```
|
||||
|
||||
For `CLAUDE_PROJECT=` — leave the value empty (no project context is carried across a mode switch initiated mid-session; the user will set it at relaunch).
|
||||
|
||||
### Step 5: Write last-mode
|
||||
|
||||
Write `/home/paul/.claude-oreillyit/last-mode` with just the mode name and a trailing newline:
|
||||
|
||||
```
|
||||
<name>
|
||||
```
|
||||
|
||||
### Step 6: Adopt the new workflow stance
|
||||
|
||||
Read the full body of the new mode's `.md` file (everything after the closing `---` of the frontmatter). This is the mode's instructions to Claude.
|
||||
|
||||
Tell the user:
|
||||
|
||||
> Mode updated to `<name>`. The new mode will be fully active after `/clear` + relaunch (driver model `<current-driver>` cannot change mid-session).
|
||||
>
|
||||
> In this session, the following changes are active immediately:
|
||||
> - **Workflow stance**: [summarise the key stance change in 1-2 sentences based on the mode body]
|
||||
> - **Subagent policy**: [summarise from the Subagent policy section]
|
||||
> - **Async policy**: [enabled / disabled based on async_ok]
|
||||
> - **Plan mode**: [auto / manual / never, from plan_mode_auto]
|
||||
>
|
||||
> Adopting new stance now.
|
||||
|
||||
Then behave according to the new mode's body prose for the remainder of the session. The driver model (`<current-driver>`) is fixed — acknowledge this if the new mode's driver differs.
|
||||
|
||||
### Error handling
|
||||
|
||||
- If `$ARGUMENTS` is set but does not match any mode name: say "Unknown mode: `<arg>`. Available modes: quick, deep, hybrid, orch, chat." and show the menu.
|
||||
- If the user picks their current mode: say "You are already in `<name>` mode. No change made." and stop.
|
||||
- If a file write fails: report the error and tell the user to check permissions on `/home/paul/.claude-oreillyit/`.
|
||||
Reference in New Issue
Block a user