AgentSkillsCN

rebuild-restart-daemon

为 Discode 项目重新构建并重启 Discode 守护进程。当 Codex 需要将本地代码变更应用到正在运行的守护进程、从陈旧的守护进程状态中恢复,或在配置与环境更新后验证守护进程健康状况时,可使用此技能。

SKILL.md
--- frontmatter
name: rebuild-restart-daemon
description: Rebuild and restart the Discode daemon for the discode project. Use when Codex must apply local code changes to the running daemon, recover from stale daemon state, or verify daemon health after config or environment updates.

Rebuild Restart Daemon

Overview

Rebuild the local project and restart its global daemon process with status verification. Prefer the bundled script for deterministic, repeatable execution.

Workflow

  1. Confirm the target directory is the discord-agent-bridge repository.
  2. Run the bundled script to rebuild and restart daemon.
  3. Verify daemon status and report log path when failures occur.

Execute Script

Run:

bash
bash "$(git rev-parse --show-toplevel)/.agents/skills/rebuild-restart-daemon/scripts/rebuild_restart_daemon.sh" --repo /path/to/discord-agent-bridge

If the skill bundle is mirrored under ~/.codex/skills, this path also works:

bash
bash /Users/dev/.codex/skills/rebuild-restart-daemon/scripts/rebuild_restart_daemon.sh --repo /path/to/discord-agent-bridge

Use options:

  • --repo <path>: target repository path (default: current directory)
  • --skip-build: skip bun run build and only restart daemon
  • --dry-run: print commands without executing them

Manual Fallback

Run:

bash
cd /path/to/discord-agent-bridge
bun run build
bun dist/bin/discode.js daemon stop
bun dist/bin/discode.js daemon start
bun dist/bin/discode.js daemon status

Troubleshooting

  • Inspect daemon log at ~/.discode/daemon.log.
  • Inspect daemon pid at ~/.discode/daemon.pid.
  • Re-run bun dist/bin/discode.js daemon status after resolving errors.