agentsclimarketplace

Query leads

Skill aAAaqwq/AGI-Super-Team/skills/query-leads

Search, filter, reports on CRM dataFrom its SKILL.md

Install
npx -y skills add aAAaqwq/AGI-Super-Team --skill query-leads

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.5 KB, 646 tokens by cl100k_base, as published. Nobody here has run it

CRM Query Leads

Search, filtering, and reports on CRM data

When to use

  • "show high-priority leads"
  • "who needs follow-up"
  • "how many leads from YC"
  • "CRM statistics"

Paths

WhatPath
Leads$CRM_PATH/relationships/leads.csv
Companies$CRM_PATH/contacts/companies.csv
People$CRM_PATH/contacts/people.csv
Activities$CRM_PATH/activities.csv

Basic query

import pandas as pd
from datetime import date

leads = pd.read_csv('$CRM_PATH/relationships/leads.csv')
people = pd.read_csv('$CRM_PATH/contacts/people.csv')
companies = pd.read_csv('$CRM_PATH/contacts/companies.csv')

Common queries

High-priority leads

high = leads[leads['priority'] == 'high']
print(high[['lead_id', 'company_id', 'stage', 'next_action']])

Follow-ups for today

today = str(date.today())
followups = leads[leads['next_action_date'] == today]
print(followups[['lead_id', 'company_id', 'next_action']])

By source

# All inbound leads
inbound = leads[leads['source_direction'] == 'inbound']

# All from a specific source
from_facebook = leads[leads['source'] == 'facebook']

# Filter by campaign detail
campaign = leads[leads['source_detail'].str.contains('lookalike', na=False)]

By stage

# Leads in negotiation
negotiation = leads[leads['stage'] == 'negotiation']

# Won deals
won = leads[leads['stage'] == 'won']

Statistics

# Count by stage
print(leads['stage'].value_counts())

# Count by priority
print(leads['priority'].value_counts())

# Count by source
print(leads['source'].value_counts())

Joining leads with companies and people

# Add company name to leads
merged = leads.merge(
    companies[['company_id', 'name', 'industry']],
    on='company_id',
    how='left'
)

# Add primary contact info
merged = merged.merge(
    people[['person_id', 'first_name', 'last_name', 'email']],
    left_on='primary_contact_id',
    right_on='person_id',
    how='left'
)

Export results

# To CSV
hot.to_csv('/tmp/hot_leads.csv', index=False)

# To JSON
hot.to_json('/tmp/hot_leads.json', orient='records', force_ascii=False)

# Just a list of emails
emails = hot['email'].dropna().tolist()
print(', '.join(emails))

Related skills

  • add-lead -- add a new lead
  • update-lead -- update existing record
  • show-today -- tasks related to CRM

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.