From kc-nightwatch
Use when setting up, configuring, or managing kc-nightwatch scheduling and settings. Triggered by '/kc-nightwatch-config', or when user asks to schedule nightwatch, change cron time, configure Slack channel, or check what plugins are monitored.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kc-nightwatch:kc-nightwatch-configThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Manage nightwatch schedule, Slack channel, and monitored plugins.
Manage nightwatch schedule, Slack channel, and monitored plugins.
/kc-nightwatch-config — overview: show current config status/kc-nightwatch-config schedule — manage cron schedule/kc-nightwatch-config channel — configure Slack notification channel/kc-nightwatch-config plugins — view and manage monitored pluginsRoute to the appropriate section below.
Check if config directory and files exist. If not, create them:
mkdir -p ~/.claude/kc-plugins-config
If nightwatch-targets.yaml does not exist:
Create a starter file with one commented-out example:
# kc-nightwatch monitoring targets
# See README.md for field documentation
#
# Example:
# my-plugin:
# type: plugin
# path: ~/Project/my-workspace/my-plugin
# repo: my-plugins
# north_star: "My plugin works perfectly"
# keywords: [my-plugin, feature-x]
# sources: [journal, episodic-memory, memory-md]
# actions: [quick-fix, proposal]
# proxy_signals:
# - id: quality
# description: "Plugin quality metric"
# target: "100%"
targets: {}
Log: [BOOTSTRAP] Created nightwatch-targets.yaml — add targets with /kc-nightwatch-config plugins
If nightwatch-improvement-log.md does not exist:
Create with initial frontmatter:
---
last_run: null
runs: 0
---
If channels.yaml does not exist: Create empty file. Channel will be asked on first run.
If language.yaml does not exist: Create with default:
default: en
overrides: []
Show current configuration at a glance:
# launchd status
launchctl list 2>/dev/null | grep com.kc.nightwatch
# Installed plist
ls -la ~/Library/LaunchAgents/com.kc.nightwatch.plist 2>/dev/null
# Wrapper script
ls -la ~/.claude/scripts/nightwatch-cron.sh 2>/dev/null
Read:
~/.claude/kc-plugins-config/channels.yaml → nightwatch key~/.claude/kc-plugins-config/nightwatch-targets.yaml → target count + types~/.claude/kc-plugins-config/nightwatch-improvement-log.md (from kc-nightwatch plugin dir) → last run + total runs🌙 kc-nightwatch Config
Schedule: {HH:MM daily} (launchd) | NOT INSTALLED
Slack: #{channel_name} ({channel_id}) | NOT CONFIGURED
Targets: {plugin_count} plugins, {product_count} products ({total} total)
Last run: {date} (run #{number}) | Never
Use:
/kc-nightwatch-config schedule — install/change/remove schedule
/kc-nightwatch-config channel — set Slack channel
/kc-nightwatch-config plugins — view/add monitoring targets
schedule)Uses launchd (macOS native scheduler). Templates live in config/ within the plugin source.
config/com.kc.nightwatch.plist (placeholders: __HOME__, __HOUR__, __MINUTE__)config/nightwatch-cron.sh (uses ~/.claude/plugins/local/ paths, no workspace placeholder needed)launchctl list 2>/dev/null | grep com.kc.nightwatch
ls ~/Library/LaunchAgents/com.kc.nightwatch.plist 2>/dev/null
Current schedule: {HH:MM daily (launchd)} or "not installed"
[I]nstall — set up nightly schedule (default: 3:00 AM)
[C]hange — update schedule time
[R]emove — uninstall schedule
[S]tatus — just show current state (done)
Wait for user input.
Ask user for preferred time:
幾點執行 nightwatch?(default: 03:00)
格式:HH:MM (24hr)
Parse input:
03:00 or 3:00 → Hour=3, Minute=004:30 → Hour=4, Minute=30Copy template from plugin source to install location (no placeholder replacement needed — script uses ~/.claude/plugins/local/ paths):
PLUGIN_SRC="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/../.." && pwd)}"
config/nightwatch-cron.sh from plugin source to ~/.claude/scripts/nightwatch-cron.shchmod +x ~/.claude/scripts/nightwatch-cron.shSkip if installed script is already up-to-date (compare content).
config/com.kc.nightwatch.plist from plugin source__HOME__ → $HOME (e.g., /Users/kent)__HOUR__ → parsed hour (integer)__MINUTE__ → parsed minute (integer)~/Library/LaunchAgents/com.kc.nightwatch.plistIf changing (job already loaded):
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.kc.nightwatch.plist 2>/dev/null
Load the job:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.kc.nightwatch.plist
launchctl list | grep com.kc.nightwatch
Display:
✅ Schedule installed: {HH:MM} daily (launchd)
Plist: ~/Library/LaunchAgents/com.kc.nightwatch.plist
Script: ~/.claude/scripts/nightwatch-cron.sh
Log: /tmp/kc-nightwatch.log
launchd will run missed jobs when Mac wakes from sleep.
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.kc.nightwatch.plist 2>/dev/null
rm ~/Library/LaunchAgents/com.kc.nightwatch.plist
Verify: launchctl list | grep com.kc.nightwatch should return nothing.
✅ Schedule removed. Nightwatch will no longer run automatically.
Manual run: /kc-nightwatch
Script preserved: ~/.claude/scripts/nightwatch-cron.sh
channel)Read ~/.claude/kc-plugins-config/channels.yaml → nightwatch key.
Nightwatch 晨報要發到哪個 Slack channel?
輸入 channel 名稱(我會搜尋 ID)或直接貼 channel ID:
Use slack_search_channels with user's input. Present matches:
找到以下 channels:
1. #my-team (C0XXXXXXXXX)
2. #my-team-pr (C0YYYYYYYYY)
哪一個?(1/2)
Update ~/.claude/kc-plugins-config/channels.yaml:
nightwatch:
id: "{channel_id}" # {channel_name}; set via /kc-nightwatch-config {date}
defaults:
tone: internal
lang: zh-TW
mention: ""
Ask user:
要發一則測試訊息確認嗎?[Y/n]
If yes → send a brief test message:
🌙 kc-nightwatch 測試 — channel 配置完成 ✅
plugins)Read ~/.claude/kc-plugins-config/nightwatch-targets.yaml.
🌙 Monitoring Targets ({count})
| Target | Type | Repo | North Star | Actions |
|--------|------|------|------------|---------|
| {name} | {type} | {repo} | {north_star (truncated to 50 chars)} | {actions} |
| ... | ... | ... | ... | ... |
# Commented-out targets are disabled templates
[A]dd — add a new target to monitoring
[V]iew — view full north star + proxy signals for a target
[E]nable — uncomment a commented-out target
[D]one — exit
Add flow:
plugin — ask for plugin name (e.g., kc-pr-flow). Path is auto-resolved at runtime from ~/.claude/plugins/local/ or $KC_WORKSPACE. Optionally ask for explicit path override.product — ask for target path (required); verify it's a git repo; ask for linear_team, linear_project, sentry_org, sentry_projects (optional)plugin: sources [journal, episodic-memory, memory-md], actions [quick-fix, proposal]product: sources [journal, episodic-memory, memory-md], actions [proposal, linear-issue]~/.claude/kc-plugins-config/nightwatch-targets.yaml/kc-nightwatch --dry-run to verify the new target is picked up"Enable flow:
View flow:
npx claudepluginhub iamcxa/kc-claude-plugins --plugin kc-nightwatchMonitors harness health across four observability layers: operational cadence, trend visibility, telemetry export, and meta-observability. Use for health checks, cadence setup, snapshot analysis, and telemetry config.
Configures Laravel Nightwatch sampling, filtering, and redaction rules to manage data volume, protect PII, and optimize production event collection.
Displays and edits .aweek/config.json settings including time zone, stale task window, and heartbeat interval with confirmation gate. Shows hardcoded scheduler and lock constants.