diff --git a/.claude/commands/deepwork_jobs.implement.md b/.claude/commands/deepwork_jobs.implement.md index 98d5c7d1..04cf12d3 100644 --- a/.claude/commands/deepwork_jobs.implement.md +++ b/.claude/commands/deepwork_jobs.implement.md @@ -231,11 +231,9 @@ This will: - Generate slash-commands for each step - Make the commands available in `.claude/commands/` (or appropriate platform directory) -### Step 6: Reload Commands +### Step 6: Relay Reload Instructions -Instruct the user to reload commands in their current session: -- Run `/reload` command (if available) -- Or restart the Claude session +After running `deepwork sync`, look at the "To use the new commands" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new commands. Don't just reference the sync output - tell them directly what they need to do (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code, or "Run '/memory refresh'" for Gemini CLI). ### Step 7: Consider Policies for the New Job @@ -461,7 +459,7 @@ After running `deepwork sync`, the following slash-commands are now available: ## Next Steps -1. **Reload commands**: Run `/reload` or restart your Claude session +1. **Reload commands**: [Include the specific reload instructions from the `deepwork sync` output here] 2. **Start the workflow**: Run `/[job_name].[first_step_id]` to begin 3. **Test the job**: Try executing the first step to ensure everything works @@ -488,7 +486,7 @@ Before marking this step complete, ensure: - [ ] Each instruction file is complete and actionable - [ ] `deepwork sync` executed successfully - [ ] Commands generated in platform directory -- [ ] User informed of next steps (reload commands) +- [ ] User informed to follow reload instructions from `deepwork sync` - [ ] implementation_summary.md created - [ ] Considered whether policies would benefit this job (Step 7) - [ ] If policies suggested, offered to run `/deepwork_policy.define` diff --git a/.claude/commands/deepwork_jobs.learn.md b/.claude/commands/deepwork_jobs.learn.md index 73a558f9..0a1f63be 100644 --- a/.claude/commands/deepwork_jobs.learn.md +++ b/.claude/commands/deepwork_jobs.learn.md @@ -291,7 +291,7 @@ If instruction files were modified: - [Any additional suggestions] ``` -3. **Instruct user to reload** if commands were regenerated +3. **If commands were regenerated**, look at the "To use the new commands" section in the `deepwork sync` output and **relay these exact reload instructions to the user** (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code) ## File Reference Patterns @@ -382,7 +382,7 @@ I found the following job executions: **Summary** -Created `learning_summary.md` documenting all changes. Please run `/reload` to get the updated commands. +Created `learning_summary.md` documenting all changes. To get the updated commands, type 'exit' then run 'claude --resume'. ``` ## Handling Edge Cases diff --git a/.deepwork/jobs/deepwork_jobs/steps/implement.md b/.deepwork/jobs/deepwork_jobs/steps/implement.md index de77741d..a6ac706d 100644 --- a/.deepwork/jobs/deepwork_jobs/steps/implement.md +++ b/.deepwork/jobs/deepwork_jobs/steps/implement.md @@ -161,11 +161,9 @@ This will: - Generate slash-commands for each step - Make the commands available in `.claude/commands/` (or appropriate platform directory) -### Step 6: Reload Commands +### Step 6: Relay Reload Instructions -Instruct the user to reload commands in their current session: -- Run `/reload` command (if available) -- Or restart the Claude session +After running `deepwork sync`, look at the "To use the new commands" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new commands. Don't just reference the sync output - tell them directly what they need to do (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code, or "Run '/memory refresh'" for Gemini CLI). ### Step 7: Consider Policies for the New Job @@ -391,7 +389,7 @@ After running `deepwork sync`, the following slash-commands are now available: ## Next Steps -1. **Reload commands**: Run `/reload` or restart your Claude session +1. **Reload commands**: [Include the specific reload instructions from the `deepwork sync` output here] 2. **Start the workflow**: Run `/[job_name].[first_step_id]` to begin 3. **Test the job**: Try executing the first step to ensure everything works @@ -418,7 +416,7 @@ Before marking this step complete, ensure: - [ ] Each instruction file is complete and actionable - [ ] `deepwork sync` executed successfully - [ ] Commands generated in platform directory -- [ ] User informed of next steps (reload commands) +- [ ] User informed to follow reload instructions from `deepwork sync` - [ ] implementation_summary.md created - [ ] Considered whether policies would benefit this job (Step 7) - [ ] If policies suggested, offered to run `/deepwork_policy.define` diff --git a/.deepwork/jobs/deepwork_jobs/steps/learn.md b/.deepwork/jobs/deepwork_jobs/steps/learn.md index 7a6d1c62..a1ed6236 100644 --- a/.deepwork/jobs/deepwork_jobs/steps/learn.md +++ b/.deepwork/jobs/deepwork_jobs/steps/learn.md @@ -228,7 +228,7 @@ If instruction files were modified: - [Any additional suggestions] ``` -3. **Instruct user to reload** if commands were regenerated +3. **If commands were regenerated**, look at the "To use the new commands" section in the `deepwork sync` output and **relay these exact reload instructions to the user** (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code) ## File Reference Patterns @@ -319,7 +319,7 @@ I found the following job executions: **Summary** -Created `learning_summary.md` documenting all changes. Please run `/reload` to get the updated commands. +Created `learning_summary.md` documenting all changes. To get the updated commands, type 'exit' then run 'claude --resume'. ``` ## Handling Edge Cases diff --git a/.gemini/commands/deepwork_jobs/implement.toml b/.gemini/commands/deepwork_jobs/implement.toml index 6eae959e..baa584d2 100644 --- a/.gemini/commands/deepwork_jobs/implement.toml +++ b/.gemini/commands/deepwork_jobs/implement.toml @@ -199,11 +199,9 @@ This will: - Generate slash-commands for each step - Make the commands available in `.claude/commands/` (or appropriate platform directory) -### Step 6: Reload Commands +### Step 6: Relay Reload Instructions -Instruct the user to reload commands in their current session: -- Run `/reload` command (if available) -- Or restart the Claude session +After running `deepwork sync`, look at the "To use the new commands" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new commands. Don't just reference the sync output - tell them directly what they need to do (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code, or "Run '/memory refresh'" for Gemini CLI). ### Step 7: Consider Policies for the New Job @@ -429,7 +427,7 @@ After running `deepwork sync`, the following slash-commands are now available: ## Next Steps -1. **Reload commands**: Run `/reload` or restart your Claude session +1. **Reload commands**: [Include the specific reload instructions from the `deepwork sync` output here] 2. **Start the workflow**: Run `/[job_name].[first_step_id]` to begin 3. **Test the job**: Try executing the first step to ensure everything works @@ -456,7 +454,7 @@ Before marking this step complete, ensure: - [ ] Each instruction file is complete and actionable - [ ] `deepwork sync` executed successfully - [ ] Commands generated in platform directory -- [ ] User informed of next steps (reload commands) +- [ ] User informed to follow reload instructions from `deepwork sync` - [ ] implementation_summary.md created - [ ] Considered whether policies would benefit this job (Step 7) - [ ] If policies suggested, offered to run `/deepwork_policy.define` diff --git a/.gemini/commands/deepwork_jobs/learn.toml b/.gemini/commands/deepwork_jobs/learn.toml index 6c7595f4..394c4cdf 100644 --- a/.gemini/commands/deepwork_jobs/learn.toml +++ b/.gemini/commands/deepwork_jobs/learn.toml @@ -260,7 +260,7 @@ If instruction files were modified: - [Any additional suggestions] ``` -3. **Instruct user to reload** if commands were regenerated +3. **If commands were regenerated**, look at the "To use the new commands" section in the `deepwork sync` output and **relay these exact reload instructions to the user** (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code) ## File Reference Patterns @@ -351,7 +351,7 @@ I found the following job executions: **Summary** -Created `learning_summary.md` documenting all changes. Please run `/reload` to get the updated commands. +Created `learning_summary.md` documenting all changes. To get the updated commands, run '/memory refresh' or restart your session. ``` ## Handling Edge Cases diff --git a/.gemini/commands/deepwork_jobs/refine.toml b/.gemini/commands/deepwork_jobs/refine.toml index 5a29751b..19523289 100644 --- a/.gemini/commands/deepwork_jobs/refine.toml +++ b/.gemini/commands/deepwork_jobs/refine.toml @@ -292,7 +292,7 @@ After updating the changelog: ``` 2. **Reload commands** - - Instruct user to run `/reload` or restart session + - Instruct user to follow the reload instructions shown by `deepwork sync` 3. **Provide summary** - Show what changed @@ -410,7 +410,7 @@ Now run: deepwork sync ``` -Then reload your session and you'll have: +Then follow the reload instructions shown by `deepwork sync` and you'll have: - /competitive_research.validate_positioning (new!) - All other commands updated ``` diff --git a/src/deepwork/cli/sync.py b/src/deepwork/cli/sync.py index e127e49b..b533eb58 100644 --- a/src/deepwork/cli/sync.py +++ b/src/deepwork/cli/sync.py @@ -117,6 +117,7 @@ def sync_commands(project_path: Path) -> None: # Sync each platform generator = CommandGenerator() stats = {"platforms": 0, "commands": 0, "hooks": 0} + synced_adapters: list[AgentAdapter] = [] for platform_name in platforms: try: @@ -157,6 +158,7 @@ def sync_commands(project_path: Path) -> None: console.print(f" [red]✗[/red] Failed to sync hooks: {e}") stats["platforms"] += 1 + synced_adapters.append(adapter) # Summary console.print() @@ -174,3 +176,10 @@ def sync_commands(project_path: Path) -> None: console.print(table) console.print() + + # Show reload instructions for each synced platform + if synced_adapters and stats["commands"] > 0: + console.print("[bold]To use the new commands:[/bold]") + for adapter in synced_adapters: + console.print(f" [cyan]{adapter.display_name}:[/cyan] {adapter.reload_instructions}") + console.print() diff --git a/src/deepwork/core/adapters.py b/src/deepwork/core/adapters.py index 1ddcb537..82afa868 100644 --- a/src/deepwork/core/adapters.py +++ b/src/deepwork/core/adapters.py @@ -57,6 +57,12 @@ class AgentAdapter(ABC): commands_dir: ClassVar[str] = "commands" command_template: ClassVar[str] = "command-job-step.md.jinja" + # Instructions for reloading commands after sync (shown to users) + # Subclasses should override with platform-specific instructions. + reload_instructions: ClassVar[str] = ( + "Restart your AI assistant session to use the new commands." + ) + # Mapping from generic CommandLifecycleHook to platform-specific event names. # Subclasses should override this to provide platform-specific mappings. hook_name_mapping: ClassVar[dict[CommandLifecycleHook, str]] = {} @@ -253,6 +259,12 @@ class ClaudeAdapter(AgentAdapter): display_name = "Claude Code" config_dir = ".claude" + # Claude Code doesn't have a reload command - must restart session + reload_instructions: ClassVar[str] = ( + "Type 'exit' to leave your current session, then run " + "'claude --resume' (your history will be maintained)." + ) + # Claude Code uses PascalCase event names hook_name_mapping: ClassVar[dict[CommandLifecycleHook, str]] = { CommandLifecycleHook.AFTER_AGENT: "Stop", @@ -333,6 +345,11 @@ class GeminiAdapter(AgentAdapter): config_dir = ".gemini" command_template = "command-job-step.toml.jinja" + # Gemini CLI can reload with /memory refresh + reload_instructions: ClassVar[str] = ( + "Run '/memory refresh' to reload commands, or restart your Gemini CLI session." + ) + # Gemini CLI does NOT support command-level hooks # Hooks are global/project-level in settings.json, not per-command hook_name_mapping: ClassVar[dict[CommandLifecycleHook, str]] = {} diff --git a/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md b/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md index c5f55ae6..60a68827 100644 --- a/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md +++ b/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md @@ -167,11 +167,9 @@ This will: - Generate slash-commands for each step - Make the commands available in `.claude/commands/` (or appropriate platform directory) -### Step 6: Reload Commands +### Step 6: Relay Reload Instructions -Instruct the user to reload commands in their current session: -- Run `/reload` command (if available) -- Or restart the Claude session +After running `deepwork sync`, look at the "To use the new commands" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new commands. Don't just reference the sync output - tell them directly what they need to do (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code, or "Run '/memory refresh'" for Gemini CLI). ### Step 7: Consider Policies for the New Job @@ -397,7 +395,7 @@ After running `deepwork sync`, the following slash-commands are now available: ## Next Steps -1. **Reload commands**: Run `/reload` or restart your Claude session +1. **Reload commands**: [Include the specific reload instructions from the `deepwork sync` output here] 2. **Start the workflow**: Run `/[job_name].[first_step_id]` to begin 3. **Test the job**: Try executing the first step to ensure everything works @@ -424,7 +422,7 @@ Before marking this step complete, ensure: - [ ] Each instruction file is complete and actionable - [ ] `deepwork sync` executed successfully - [ ] Commands generated in platform directory -- [ ] User informed of next steps (reload commands) +- [ ] User informed to follow reload instructions from `deepwork sync` - [ ] implementation_summary.md created - [ ] Considered whether policies would benefit this job (Step 7) - [ ] If policies suggested, offered to run `/deepwork_policy.define` diff --git a/src/deepwork/standard_jobs/deepwork_jobs/steps/learn.md b/src/deepwork/standard_jobs/deepwork_jobs/steps/learn.md index 7a6d1c62..a1ed6236 100644 --- a/src/deepwork/standard_jobs/deepwork_jobs/steps/learn.md +++ b/src/deepwork/standard_jobs/deepwork_jobs/steps/learn.md @@ -228,7 +228,7 @@ If instruction files were modified: - [Any additional suggestions] ``` -3. **Instruct user to reload** if commands were regenerated +3. **If commands were regenerated**, look at the "To use the new commands" section in the `deepwork sync` output and **relay these exact reload instructions to the user** (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code) ## File Reference Patterns @@ -319,7 +319,7 @@ I found the following job executions: **Summary** -Created `learning_summary.md` documenting all changes. Please run `/reload` to get the updated commands. +Created `learning_summary.md` documenting all changes. To get the updated commands, type 'exit' then run 'claude --resume'. ``` ## Handling Edge Cases