Files

3.3 KiB

🚀 Quick Start Guide

Get Smart Follow-ups running in under 5 minutes.

1️⃣ Prerequisites

2️⃣ Installation

cd /root/bot/skills/smart-followups
npm install
chmod +x cli/followups-cli.js test.sh

3️⃣ Set API Key

export ANTHROPIC_API_KEY="sk-ant-your-key-here"

Or add to ~/.bashrc / ~/.zshrc for persistence:

echo 'export ANTHROPIC_API_KEY="sk-ant-your-key-here"' >> ~/.bashrc
source ~/.bashrc

4️⃣ Test It!

Quick Test

./test.sh

This runs all output modes with sample data.

Manual Test

# JSON output
cat test-example.json | node cli/followups-cli.js --mode json

# Text output (Signal/iMessage format)
cat test-example.json | node cli/followups-cli.js --mode text

# Telegram button format
cat test-example.json | node cli/followups-cli.js --mode telegram

Custom Test

# Create your own conversation
echo '[{"user":"What is Rust?","assistant":"Rust is a systems programming language..."}]' | \
  node cli/followups-cli.js --mode text

5️⃣ Expected Output

Text mode should look like:

💡 Smart Follow-up Suggestions

⚡ Quick
1. What are containers vs VMs?

🧠 Deep Dive
2. Explain Docker's architecture

🔗 Related
3. What about Kubernetes?

Reply with a number (1-3) to ask that question.

JSON mode should return:

{
  "quick": "What are containers vs VMs?",
  "deep": "Explain Docker's architecture",
  "related": "What about Kubernetes?"
}

6️⃣ Integrate with Bot

See SKILL.md for full integration guide.

TL;DR:

  1. Copy this folder to Bot's skills directory
  2. Add to bot.config.json:
    {
      "skills": {
        "smart-followups": {
          "enabled": true,
          "autoTrigger": false
        }
      }
    }
    
  3. Restart Bot
  4. Use /followups in any conversation

🐛 Troubleshooting

"ANTHROPIC_API_KEY environment variable is required"

Fix: Set the API key (see step 3)

"Error: Cannot find module '@anthropic-ai/sdk'"

Fix: Run npm install in this directory

Very slow responses (>5 seconds)

Check:

  • Are you using Haiku? (--model claude-haiku-4)
  • Network connection stable?
  • Large conversation context?

Errors about JSON parsing

Likely: API returned non-JSON. Check:

# Enable verbose logging (future feature)
DEBUG=* node cli/followups-cli.js ...

📚 Next Steps

💡 Tips

  1. Use Haiku: Default model, fastest and cheapest
  2. Manual trigger: Start with /followups command, not auto-mode
  3. Test locally: Verify CLI works before integrating with Bot
  4. Monitor costs: ~$0.0001 per generation with Haiku

✅ Checklist

  • Node.js 18+ installed
  • API key set as environment variable
  • npm install completed
  • ./test.sh runs successfully
  • CLI produces valid JSON/text output
  • Ready to integrate with Bot!

Need help? Check the main README.md or open an issue.