feat: implement task-based worker naming#323
Open
aronchick wants to merge 16 commits intodlorenc:mainfrom
Open
feat: implement task-based worker naming#323aronchick wants to merge 16 commits intodlorenc:mainfrom
aronchick wants to merge 16 commits intodlorenc:mainfrom
Conversation
Replace random adjective-animal names with descriptive task-based names. Workers are now named like 'fix-session-id' instead of 'calm-owl'. Implementation: - Extract 3-4 keywords from task description (filter stop words) - Sanitize to lowercase-hyphenated format - Handle uniqueness with numeric suffixes (-2, -3, etc.) - Fallback to random names if extraction fails - Preserve --name flag for manual override Changes: - Add names.FromTask() for task-based name generation - Add names.EnsureUnique() for uniqueness handling - Update createWorker() to use new naming by default - Add comprehensive tests (20+ test cases) - Add WORKER_NAMING_SPEC.md specification - Add WORKER_NAMING_EXAMPLES.md usage guide Benefits: - Immediate clarity on worker purpose from name - Self-documenting git branches (work/fix-session-id) - Easier debugging and monitoring in logs/tmux - Better PR identification from branch names Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2 tasks
CI Status: Lint FailingThis PR has lint errors that need to be fixed before it can be merged. Checks failing:
All other checks (Build, E2E, Unit Tests, Coverage) are passing. Action needed: Please fix the lint issues to unblock this PR. 🤖 Merge-queue agent |
* fix: append custom agent definitions to base templates instead of replacing Custom agent definitions from .multiclaude/agents/ are now appended to the base templates from ~/.multiclaude/repos/<repo>/agents/ instead of replacing them entirely. This ensures critical instructions like 'multiclaude agent complete' are never lost when users customize their agent definitions. Changes: - Add SourceMerged constant to indicate merged definitions - Update MergeDefinitions to append content with "## Custom Instructions" separator when names match - Update unit and integration tests to verify new append behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: remove extra blank line for gofmt compliance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Test User <test@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Removed gopkg.in/yaml.v3 which was listed in go.mod but never imported. Discovered via `go mod tidy` lint warning. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…Ls (dlorenc#320) Fixes two bugs in the init command: 1. The init command now checks if a repository is already initialized or if the tmux session already exists before attempting to create them. Previously, users would get cryptic "exit status 1" errors when trying to re-initialize a repo. Now they get clear error messages with actionable suggestions. 2. The GitHub URL parser now supports repository names containing dots (e.g., demos.expanso.io). The regex was too restrictive and excluded dots from repo names, causing fork detection to fail for repos with dotted names. Changes: - Add pre-flight checks in initRepo to verify repo doesn't exist in state - Check if repository directory already exists before cloning - Check if tmux session exists before attempting to create it - Update regex in ParseGitHubURL to allow dots in repository names - Update test to reflect that dots in repo names are now supported Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…add (dlorenc#322) Fixes state inconsistency issues when init or workspace add commands fail partway through execution. Previously, if these commands failed after creating tmux sessions/windows but before updating state, re-running would fail with cryptic tmux errors. Changes: - initRepo: Check for existing tmux session and state entry before creation - Auto-repair by killing stale tmux sessions - Clear error if repo already tracked in state - addWorkspace: Check for existing tmux window and worktree before creation - Auto-repair by killing stale tmux windows - Auto-repair by removing stale worktrees This improves P0 "Clear error messages" goal by preventing confusing error states and making the system self-healing. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds spec-driven proposal for unified repo lifecycle commands: - repo start: Initialize all standard agents - repo status: Comprehensive status display - repo hibernate: Pause agents, preserve state - repo wake: Resume hibernated repo - repo refresh: Sync worktrees with main - repo clean: Remove orphaned resources Includes design decisions, implementation tasks, and detailed specs. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…orenc#314) Addresses P0 roadmap item "Worktree sync". Adds: - trigger_refresh socket command in daemon - multiclaude refresh CLI command that triggers immediate worktree sync - Allows merge-queue or users to force refresh after PRs merge The existing 5-minute refresh loop continues unchanged; this adds on-demand capability for faster sync when needed. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Fork package tests were failing on machines with global git URL rewrite rules (e.g., url.git@github.com:.insteadof=https://github.com/). Tests expected exact HTTPS URLs but git was returning SSH URLs due to the global insteadOf configuration. Changes: - Add gitCmdIsolated() helper that runs git with GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM set to /dev/null for deterministic behavior - Add urlsEquivalent() helper for semantic URL comparison (owner/repo match) instead of exact string matching - Update all test git commands to use isolated environment - Update URL comparisons to use semantic equivalence This makes tests deterministic regardless of developer's local git configuration. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add repo hibernate command to archive and stop work Adds `multiclaude repo hibernate` command that cleanly stops all work in a repository while preserving uncommitted changes: - Archives uncommitted changes as patch files to ~/.multiclaude/archive/<repo>/<timestamp>/ - Saves metadata (branch, task, worktree path) for each agent - Lists untracked files separately for manual restoration - Stops workers and review agents by default (--all for persistent agents) - Force-removes worktrees after archiving to ensure clean shutdown Also adds ArchiveDir to Paths config and updates all test files to include it. Usage: multiclaude repo hibernate [--repo <repo>] [--all] [--yes] Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address lint issues in hibernate command - Check error return from client.Send (errcheck) - Fix formatting with gofmt Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Implements dlorenc#305 - adds a memorable `multiclaude status` command that: - Shows daemon status (running/not running/unhealthy) - Lists tracked repos with agent counts - Gracefully handles daemon not running (no error, just shows status) - Provides helpful hints for next steps Unlike `multiclaude list` which errors when daemon is unavailable, `multiclaude status` always succeeds and shows what it can. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ker (dlorenc#307) Extends worker template with two new capability sections: **Environment Hygiene:** - Shell history stealth (leading space prefix) - Pre-completion cleanup (verify no credentials leaked) **Feature Integration Tasks:** - Reuse First principle - Minimalist Extensions guidance - PR analysis workflow - Integration checklist Follows the concise style of the existing worker template. Fixes dlorenc#282 Fixes dlorenc#283 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: Add CI guard rails for local validation Adds Makefile and pre-commit hook to run CI checks locally before pushing. This prevents the common issue where CI fails after code is already pushed, by enabling developers to run the exact same checks that GitHub CI runs. Features: - Makefile with targets matching all CI jobs (build, unit-tests, e2e-tests, verify-docs, coverage) - Pre-commit hook script for automatic validation - Updated CLAUDE.md with usage instructions Usage: make pre-commit # Fast checks before commit make check-all # Full CI validation make install-hooks # Install git pre-commit hook * Update verify-docs to fix CI * Use double quotes for regex to avoid syntax errors * Update Makefile to include verify-docs check * Fix unused verbose variable in verify-docs
Add comprehensive tests for daemon handlers with low coverage: - handleTriggerRefresh (0% → 100%) - handleRestartAgent (validation error paths) - handleSpawnAgent (argument validation and error cases) - handleRepairState (basic functionality) - handleTaskHistory (with filters and limits) - handleListAgents (with multiple agents) - handleUpdateRepoConfig (merge queue and PR shepherd settings) - handleGetRepoConfig (validation and success cases) The tests use table-driven patterns consistent with existing tests and focus on testing argument validation and error handling paths that don't require actual tmux or Claude process startup. Co-authored-by: Test User <test@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…c#331) Add helper functions to socket package for creating responses: - ErrorResponse(format, args...) for error responses with formatting - SuccessResponse(data) for success responses Add argument extraction helpers in daemon: - getOptionalStringArg for optional string arguments with defaults - getOptionalBoolArg for optional bool arguments with defaults Refactored all 50 handler response patterns in daemon.go to use the new helpers, improving consistency and reducing boilerplate. This also simplifies fork config parsing from ~12 lines to ~4 lines. Co-authored-by: Test User <test@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Port changes from #66: - Add docs/TASK_MANAGEMENT.md with comprehensive guide for Claude Code's task management tools (TaskCreate/Update/List/Get) - Add internal/diagnostics package for machine-readable system diagnostics - Add 'multiclaude diagnostics' CLI command outputting JSON with: * Claude CLI version and capability detection * Task management support detection (v2.0+) * Environment variables (with sensitive value redaction) * System paths and tool versions * Daemon status and agent statistics - Add daemon startup diagnostics logging for monitoring - Update supervisor and worker prompts with task management guidance (adapted to new concise prompt style from dlorenc#302) The diagnostics endpoint helps operators understand the multiclaude environment, and task management enables agents to organize complex multi-step work while maintaining the "focused PRs" principle. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Simplified the character validation logic in isValidName() by applying De Morgan's law to the negated OR expression. This fixes the QF1001 staticcheck lint error. Before: !((r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '-') After: (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' Both expressions are logically equivalent but the second form is more idiomatic and what the linter expects. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace random worker names with descriptive task-based names. Workers are now named like
fix-session-id-buginstead ofcalm-owl.Changes:
names.FromTask()for extracting 3-4 keywords from task descriptionsnames.EnsureUnique()for handling duplicate names with numeric suffixescreateWorker()ininternal/cli/cli.goto use task-based namingWORKER_NAMING_SPEC.mdspecification documentWORKER_NAMING_EXAMPLES.mdusage guideKey Features:
--nameflag for custom namesExamples:
"Fix session ID bug in authentication"→fix-session-id-bug"Add user profile editing feature"→add-user-profile-editing"Implement OAuth2 login flow"→implement-oauth2-login-flowBenefits:
work/fix-session-id-bug)Test plan
go test ./...)🤖 Generated with Claude Code