跳到正文
FunCoding

ops-competitors

OPS on-demand: This skill should be used when the user asks to "competitor intel", "what did they…

Star
565
许可证
MIT
最近提交
2026年12月2日

claude-ops/skills/ops-competitors/SKILL.md

在 GitHub 上查看

Runtime Context

Before rendering, load competitor context:

PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname $(which ops-competitors 2>/dev/null) 2>/dev/null)/..}"
OPS_DATA_DIR="${OPS_DATA_DIR:-$HOME/.claude/plugins/data/ops-ops-marketplace}"
source "$PLUGIN_ROOT/scripts/lib/competitor/context.sh" 2>/dev/null || true
CTX=$(competitor_context 2>/dev/null || echo '{"configured":false,"reason":"lib_not_found"}')

OPS ► COMPETITORS — Intel Dashboard

Load ops-rules before acting. Public repo (no personal data). Outbound: one draft → one approval → one send. If AskUserQuestion / Workflow are missing, follow Rule 10 in ops-rules (Hermes: numbered options / two-turn Telegram card; delegate_task).

Parse $ARGUMENTS and dispatch to the matching mode below.


Mode: No args — Dashboard

Show all tracked brands with last_run, alert counts, and recent activity. Use competitor_briefing_line for each brand row.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 OPS ► COMPETITORS — [date]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

TRACKED BRANDS ([n] total)
  [brand]   last run [date]   [n] alerts · [n] med · [n] low
  ...

PENDING QUEUES
  immediate: [n]   daily: [n]

RECENT HIGH ALERTS (last 7d)
  [timestamp]  [brand]  [competitor]  [snippet…]
  ...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

If configured == false: print setup hint and stop.

# Load context
source "$PLUGIN_ROOT/scripts/lib/competitor/context.sh"
competitor_context --window-days 7
competitor_briefing_line

Mobile mode (Rule 7): one line per brand, no banner, no box-drawing.


Mode: <brand-name> — Drill-down

Full event timeline (last 30d), top competitors, latest report, per-competitor signal breakdown.

  1. Run competitor_context --brand "<brand>" --window-days 30
  2. Print brand metadata: category, competitor list, last_run, last_discovery
  3. Print per-competitor signal breakdown (group events by .competitor)
  4. Read latest report:
    SLUG=$(echo "<brand>" | tr '[:upper:] /' '[:lower:]--' | tr -cd 'a-z0-9-_.')
    REPORT="$OPS_DATA_DIR/reports/competitor-intel/latest-${SLUG}.md"
    [[ -f "$REPORT" ]] && head -80 "$REPORT"
    
  5. Print full high-severity event timeline sorted newest-first

Output format:

BRAND: [name]  category: [cat]  last run: [date]
competitors: [a, b, c, ...]

SIGNAL BREAKDOWN
  [competitor]   high: [n]  med: [n]  low: [n]

LATEST REPORT (excerpt)
  [first 80 lines of report]

EVENT TIMELINE (30d — [n] total)
  [timestamp]  HIGH  [competitor]  [source]  [snippet…]
  ...

Mode: refresh [brand]

Manually triggers the weekly intel cron immediately.

PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-...}"
CRON_SCRIPT="$PLUGIN_ROOT/scripts/ops-cron-competitor-intel.sh"

# If a specific brand is given, pass it via env override
if [[ -n "$BRAND_ARG" ]]; then
  BRAND_NAME="$BRAND_ARG" bash "$CRON_SCRIPT"
else
  bash "$CRON_SCRIPT"
fi

Stream output. Inform the user when done and show updated competitor_briefing_line.


Mode: add-url <brand> <competitor> <kind> <url>

Add a page-diff monitored URL to preferences.json. Valid <kind> values: pricing, features, changelog, careers.

  1. Validate args — if any missing, explain usage and stop.
  2. Show the proposed change:
    Add URL for [brand] → [competitor] ([kind]):
      [url]
    
  3. AskUserQuestion: [Add] / [Cancel]
  4. On confirm, merge via jq:
    PREFS="$OPS_DATA_DIR/preferences.json"
    jq --arg brand "$BRAND" --arg comp "$COMP" --arg kind "$KIND" --arg url "$URL" '
      .competitor_intel.urls[$brand][$comp][$kind] = $url
    ' "$PREFS" > /tmp/prefs-tmp.json && mv /tmp/prefs-tmp.json "$PREFS"
    
  5. Confirm written.

Mode: alerts

Tail the last 20 lines of the alerts log:

ALERTS="$OPS_DATA_DIR/reports/competitor-intel/alerts.log"
if [[ -f "$ALERTS" ]]; then
  tail -20 "$ALERTS"
else
  echo "No alerts log found at $ALERTS"
fi

Mode: help / unknown args

Print available subcommands:

ops-competitors                           — dashboard (all brands)
ops-competitors <brand>                   — drill-down: events, report, breakdown
ops-competitors refresh [brand]           — run intel cron now (optional brand filter)
ops-competitors add-url <b> <c> <k> <url> — add page-diff URL to preferences.json
ops-competitors alerts                    — tail alerts.log (last 20 lines)
ops-competitors help                      — this message

Error states

  • configured == false → print "Competitor-intel not configured. Run /ops:setup competitor-intel to get started." and stop.
  • CRON_SCRIPT not found → print path and stop.
  • PREFS not writable for add-url → surface error, do not silently fail.

相似的 Skill

ask-matt

MAmattpocock/skills337k近 7 天新增 4,978 个 star

chief-of-staff

MAmattpocock/skills337k近 7 天新增 4,978 个 star

setup-matt-pocock-skills

MAmattpocock/skills337k近 7 天新增 4,978 个 star

subagent-driven-development

OBobra/superpowers331k近 7 天新增 4,772 个 star

autonomous-loops

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

autonomous-agent-harness

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star