Commit Graph

28 Commits

Author SHA1 Message Date
shokollm
7c94a59bb6 fix(phase3a): separate SOUL.md personality from SKILL.md routing
- SOUL.md: only personality/voice guidance (no routing logic)
- SKILL.md: definitive routing behavior + delegation process
- Add context passing via temp file for long tasks
- Add error handling table with user-friendly messages

This aligns with Hermes docs: SOUL.md = identity, SKILL.md = behavior
2026-03-30 14:20:21 +00:00
shokollm
60181afe6a feat(phase3a): initial Chat Agent infrastructure
Phase 3a implementation - Hermes Chat Agent configuration:

- kugetsu-chat/SOUL.md - Chat Agent persona and routing logic
- kugetsu-chat/SKILL.md - Chat Agent skill documentation
- kugetsu-chat/scripts/setup - Configuration setup script
- kugetsu-pm/SKILL.md - PM Agent skill documentation
- kugetsu-helpers/SKILL.md - Helper tools for Hermes-kugetsu integration
- kugetsu-helpers/scripts/kugetsu-helpers - Shell functions for delegation

Provides:
- Intent classification (small talk, task, status, mode change)
- PM Agent delegation via terminal()
- kugetsu status checking
- Session management helpers
2026-03-30 14:07:43 +00:00
shokollm
3e12809095 fix(kugetsu): fix worktree name dash inconsistency and add worktree tests
- Fix issue_ref_to_worktree_name: use single dash for # like filename does
- Add tests for: pm-agent in index, destroy --pm-agent, worktree_path in session
- Add tests for: prune detects/removes orphaned worktrees, destroy removes worktree
- Add tests for: session file v2.2 format with worktree_path

All 28 tests pass.
2026-03-30 13:52:28 +00:00
shokollm
cf809688cf feat(kugetsu): add git worktree isolation per session
- Each issue session gets isolated git worktree to prevent workspace conflicts
- Worktree created on 'kugetsu start', removed on 'kugetsu destroy'
- Worktree path: ~/.kugetsu/worktrees/{sanitized-issue-ref}/
- Branch naming: fix/issue-{number} or fix/{identifier}
- Worktree always recreated on start (guaranteed clean state)
- 'kugetsu list' now shows worktree path
- 'kugetsu prune' also cleans orphaned worktrees
- 'kugetsu continue' runs opencode with --workdir pointing to worktree
- Update SKILL.md to v2.2 with worktree documentation

Part of issue #19 Phase 3 implementation
2026-03-30 13:45:10 +00:00
shokollm
12ad4eb3b7 feat(kugetsu): auto-create pm-agent session during init
- kugetsu init now creates both base and pm-agent sessions
- kugetsu start checks for pm-agent existence, errors if missing
- Add kugetsu destroy --pm-agent command
- Update list to show pm-agent session
- Update prune to preserve pm-agent.json
- Update SKILL.md documentation to v2.1

Part of issue #19 Phase 3 implementation
2026-03-30 13:10:47 +00:00
shokollm
c2dbb6fa8f fix(tailscale-setup): use manual repo file for Fedora due to GPG key 404
The Tailscale GPG key URL returns 404 on some systems. Creating
the repo file manually with gpgcheck=0 as a workaround.
2026-03-30 06:21:40 +00:00
shokollm
1b5cd56e66 feat(issue-17): add Tailscale VPN setup script and documentation
- Add tailscale-setup.sh:
  - Multi-distro support (Debian/Ubuntu, Fedora)
  - Automatic OS detection
  - Systemd integration for tailscaled daemon
  - User choice: AUTHKEY or headless browser login
  - Configurable device name (defaults to hostname)
  - Verification steps after setup

- Update SKILL.md:
  - Add Tailscale VPN section under Remote Access
  - Document benefits and setup commands
  - Link to full documentation

- Update docs/kugetsu-setup.md:
  - Add Tailscale section before Security Notes
  - Compare Tailscale vs port forwarding
  - Document authentication methods
  - Add post-setup usage examples
  - Include uninstall instructions
2026-03-30 05:14:17 +00:00
shokollm
3c92a12f28 feat(sshd-setup): multi-distro support and verification steps
- sshd-setup.sh: Auto-detect OS (Debian/Ubuntu/Fedora/RHEL/CentOS)
- Use appropriate package manager (apt-get vs dnf)
- Add verification steps after each major phase
- Exit with error if sshd installation fails
- Exit with error if sshd doesn't start successfully
- Add troubleshooting section in output

- kugetsu-install.sh: Add verification that kugetsu binary exists

- kugetsu-setup.md: Document multi-distro installation commands
2026-03-30 04:27:23 +00:00
shokollm
0563e7bced docs: add chmod +x instruction before executing scripts
Users should explicitly grant execute permission to downloaded scripts
for transparency and security best practices.
2026-03-30 03:42:53 +00:00
shokollm
1e2d88d811 docs(kugetsu): add SSH remote access section to SKILL.md
- Add 'Remote Access via SSH (Optional)' section
- Documents automated sshd-setup.sh usage
- Explains what the setup does
- Shows remote usage examples
- Links to full docs/kugetsu-setup.md for host-side configuration
2026-03-30 03:42:13 +00:00
shokollm
7fb9b9c581 feat(issue-11): add SSH setup script and kugetsu-setup documentation
- Add sshd-setup.sh: automated SSH setup inside container
  - Checks for systemd prerequisite
  - Creates non-root user (configurable via argument, fallback to 'kugetsu')
  - Configures sshd for key-only authentication
  - Configures passwordless sudo for the user
  - Enables and starts sshd via systemd
- Add docs/kugetsu-setup.md: unified setup documentation
  - Container setup (Incus, Docker)
  - SSH setup (automated + manual steps)
  - Host-side port forwarding (Incus, firewall)
  - kugetsu installation
  - Usage guide
  - Remote access via SSH
2026-03-30 03:37:07 +00:00
shokollm
b422b33aa6 fix(kugetsu): use before/after session list to detect forked session
Compare session list before and after fork to reliably detect which
session is the newly created one. Avoids relying on parsing output
that may not contain session ID.
2026-03-29 20:25:41 +00:00
shokollm
636a41f41b fix(kugetsu): create session file before opencode fork
Create placeholder session file and add to index BEFORE running
opencode. This ensures we have a record even if opencode takes
long time or times out. Update with real session ID after fork.
2026-03-29 20:19:38 +00:00
shokollm
c51a886aa6 fix(kugetsu): capture forked session ID from opencode output
The --fork flag outputs the new session ID. Parse that instead of
relying on session list which may return wrong session when multiple
exist. Added fallback to session list parsing.
2026-03-29 20:16:51 +00:00
shokollm
7f3952ff9d test(kugetsu): add v2.0 test suite for issue-driven session management 2026-03-29 20:01:16 +00:00
shokollm
f2ab637d1f fix(kugetsu): update install script with new commands 2026-03-29 20:00:17 +00:00
shokollm
e014d7bfb9 fix(kugetsu): fix bash substitution error in cmd_start
The function call inside ${} syntax was invalid. Changed to use
command substitution $(...) instead.
2026-03-29 19:53:42 +00:00
shokollm
7146e3bd92 feat(kugetsu): implement issue-driven session management
- Add kugetsu init to create base session via TUI
- Add kugetsu start/continue for issue-based task handling
- Add kugetsu list/prune/destroy for session lifecycle
- Implement directory files + index.json storage pattern
- Use issue ref format: instance/user/repo#number
- Fork from base session enables headless operation

Solves: opencode headless CLI limitation discovered in issue #14
2026-03-29 19:51:51 +00:00
shokollm
e397a64d27 feat(kugetsu): add --debug flag for real-time output capture
- Add --debug flag to start/resume for verbose opencode output
- Use stdbuf -oL to unbuffer stdout for real-time display
- Capture debug logs to ~/.kugetsu/sessions/<id>/debug.log
- Add --debug to stop/destroy for viewing logs before actions
- Position-agnostic flag parsing (--debug can appear anywhere in args)
2026-03-29 16:23:10 +00:00
shokollm
dd9a444920 feat: add destroy command and session_id validation
- Add destroy subcommand for deleting sessions
- Add destroy --all for fresh start with confirmation
- Add -y flag to skip confirmation prompts
- Add validate_session_id() to reject empty session_ids
- Remove misleading force resume error message
- Update SKILL.md to v1.1 with destroy documentation
2026-03-29 14:34:56 +00:00
shokollm
b992949314 fix: resolve test failures - all 12 tests pass
- Fix bash pipe/exit status issue with set -euo pipefail
- Change from: if ! cmd | grep -q pattern
- Change to: OUTPUT=$(cmd || true); if echo "$OUTPUT" | grep -q pattern
- Add test isolation cleanup (rm specific session, not all)
- Add 'Using provided message:' output to kugetsu resume
- Fix grep pattern: 'cannot be resumed' not 'not resumable'
2026-03-29 14:10:45 +00:00
shokollm
5a9c3a87a9 test: add kugetsu test suite 2026-03-29 11:12:19 +00:00
shokollm
7edb54cd3f feat: add kugetsu session manager skill
- skills/kugetsu/SKILL.md: Agent skill documentation following agentskills.io spec
- skills/kugetsu/scripts/kugetsu: Shell wrapper for opencode session management
  - Commands: start, list [--all], resume, stop, help
  - State tracking: used → idle (graceful) or left (interrupted)
  - Auto-fill message on resume
  - Confirmation prompt when resuming used session
- skills/kugetsu/scripts/kugetsu-install.sh: Installation script for users

Implements Phase 1 of issue #11 - basic session management layer
for remote agent control without Hermes dependency.
2026-03-29 10:50:14 +00:00
shokollm
7eb83454ba fix: exec opencode.real directly to avoid re-invoking wrapper 2026-03-27 13:43:13 +00:00
shokollm
94f08c1b8d fix: use realpath -m instead of cd to get absolute path for worktree base 2026-03-27 13:37:51 +00:00
shokollm
2010275dda fix: use absolute path for worktree to prevent nested worktrees 2026-03-27 13:24:25 +00:00
shokollm
b1dc002b09 refactor: remove duplicate script from SKILL.md, use reference instead 2026-03-27 13:05:09 +00:00
shokollm
63b89eed6d feat: add opencode-worktree skill for isolated sessions
- Adds skills/opencode-worktree/ with SKILL.md and opencode-worktree.sh
- Creates unique git worktree per session (e.g. session-20260327-a1b2c3-refactor-auth)
- Cleans up stale worktrees on every launch
- Branch always based on main
- User can source directly or copy to PATH
2026-03-27 12:59:41 +00:00