oyi77

joko-proactive-agent

Proactive agent that detects signals and suggests actions with Slack notifications

oyi77 1 Updated 3mo ago

Resources

6
GitHub

Install

npx skillscat add oyi77/1ai-skills/joko-proactive-agent

Install via the SkillsCat registry.

SKILL.md

Joko Proactive Agent

Proactive agent that monitors business signals, detects opportunities/issues, and suggests actions with Slack notifications.

Required Tools

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": { "SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}" }
    },
    "notion": {
      "command": "npx",
      "args": ["-y", "@makenotion/mcp-server"],
      "env": { "NOTION_API_KEY": "${NOTION_API_KEY}" }
    }
  }
}

MCP References

Capabilities

  • Monitor Notion databases for changes
  • Send proactive alerts to Slack channels
  • Suggest actions based on detected patterns
  • Log all detections in Notion for tracking

Pseudo Code

Monitor Database Changes

// 1. Query Notion database for recent items
const recentItems = await notion.databases.query({
  databaseId: salesPipelineId,
  filter: {
    "property": "Last Updated",
    "date": { "after": "24 hours ago" }
  }
});

// 2. Analyze each item for signals
for (const item of recentItems.results) {
  const signals = detectSignals(item);
  
  if (signals.length > 0) {
    // 3. Log detection in Notion
    await notion.pages.create({
      parent: { databaseId: signalLogDbId },
      properties: {
        "Signal": { "rich_text": [{ "text": { "content": signals.join(", ") } }] },
        "Source": { "url": item.url },
        "Priority": { "select": { "name": signals.length > 2 ? "High" : "Medium" } },
        "Status": { "status": { "name": "New" } }
      }
    });

    // 4. Send proactive Slack notification
    await slack.chat_postMessage({
      channel: "#sales-alerts",
      text: `Signal detected: ${item.properties.Name.title[0].plain_text}`,
      blocks: [
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": `*Action Required*\n${signals.join("\n• ")}\n<${item.url}|View in Notion>`
          }
        },
        {
          "type": "actions",
          "elements": [
            {
              "type": "button",
              "text": { "type": "plain_text", "text": "Take Action" },
              "url": item.url
            }
          ]
        }
      ]
    });
  }
}

Detect Business Signals

function detectSignals(item: any): string[] {
  const signals: string[] = [];
  
  // Signal: Deal stuck in same stage > 7 days
  const daysInStage = getDaysInStage(item);
  if (daysInStage > 7) {
    signals.push(`Deal stalled: ${daysInStage} days in current stage`);
  }
  
  // Signal: High-value deal
  const value = item.properties.Value?.number || 0;
  if (value > 10000) {
    signals.push(`High-value deal: $${value.toLocaleString()}`);
  }
  
  // Signal: Competitor mentioned
  const notes = item.properties.Notes?.rich_text[0]?.plain_text || "";
  if (notes.match(/competitor|comparison|alternative/gi)) {
    signals.push("Competitor mentioned in notes");
  }
  
  return signals;
}

Skill v2.0 - Joko Proactive Agent