agentleFS
stoa-platformstoa-platform/stoa/.claude/skills/analytics/SKILL.md

analytics

Skill9 starsChanged 7 months agoApache-2.0View on GitHub

Query platform data — PostgreSQL (prod), token costs, Prometheus metrics, GitHub CI stats, K8s pod status.

69 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use popups, free-tools and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CesarjoquinSkill

    popups

    When the user wants to create or optimize popups, modals, overlays, slide-ins, or banners for conversion purposes. Also use when the user mentions "exit intent," "popup conversions," "modal optimization," "lead capture popup," "email popup," "announcement banner," "overlay," "collect emails with a popup," "exit popup," "scroll trigger," "sticky bar," or "notification bar." Use this for any overlay or interrupt-style conversion element. For forms outside of popups, see cro. For general page conversion optimization, see cro.

    Also in 23 projects that use this

  • CesarjoquinSkill

    free-tools

    When the user wants to plan, evaluate, or build a free tool for marketing purposes — lead generation, SEO value, or brand awareness. Also use when the user mentions "engineering as marketing," "free tool," "marketing tool," "calculator," "generator," "interactive tool," "lead gen tool," "build a tool for leads," "free resource," "ROI calculator," "grader tool," "audit tool," "should I build a free tool," or "tools for lead gen." Use this whenever someone wants to build something useful and give it away to attract leads or earn links. For downloadable content lead magnets (ebooks, checklists, templates), see lead-magnets.

    Also in 24 projects that use this

  • coreyhaines31Skill

    marketing-council

    When the user wants multiple expert perspectives on a marketing question — a simulated board of advisors staffed by legendary marketers (Seth Godin, David Ogilvy, Eugene Schwartz, April Dunford, Rory Sutherland, Alex Hormozi, Byron Sharp, and more). Also use when the user mentions 'marketing council,' 'board of advisors,' 'advisory board,' 'what would Seth Godin say,' 'what would Ogilvy think,' 'channel Hormozi,' 'get multiple perspectives,' 'debate this,' 'have the council review,' 'marketing mentors,' or asks how a famous marketer would approach their problem. The council gives each advisor's take through their documented frameworks, surfaces where they disagree, and synthesizes a recommendation. For executing the winning direction, hand off to positioning, offers, copywriting, ads, or the relevant skill.

    Also in 19 projects that use this

  • roerohanSkill

    emails

    When the user wants to create or optimize an email sequence, drip campaign, automated email flow, or lifecycle email program. Also use when the user mentions "email sequence," "drip campaign," "nurture sequence," "onboarding emails," "welcome sequence," "re-engagement emails," "email automation," "lifecycle emails," "trigger-based emails," "email funnel," "email workflow," "what emails should I send," "welcome series," or "email cadence." Use this for any multi-email automated flow. For cold outreach emails, see cold-email. For in-app onboarding, see onboarding.

    Also in 21 projects that use this

  • ukunal91appSkill

    community-marketing

    Build and leverage online communities to drive product growth and brand loyalty. Use when the user wants to create a community strategy, grow a Discord or Slack community, manage a forum or subreddit, build brand advocates, increase word-of-mouth, drive community-led growth, engage users post-signup, or turn customers into evangelists. Trigger phrases: "build a community," "community strategy," "Discord community," "Slack community," "community-led growth," "brand advocates," "user community," "forum strategy," "community engagement," "grow our community," "ambassador program," "community flywheel.

    Also in 26 projects that use this

  • coreyhaines31Skill

    marketing-loops

    When the user wants to set up a recurring, self-running marketing workflow — a repeatable loop an AI agent runs on a cadence (weekly, daily, on a trigger) rather than a one-off task. Also use when the user mentions 'marketing loop,' 'recurring marketing workflow,' 'automate my marketing,' 'marketing on autopilot,' 'weekly marketing review,' 'ad fatigue check,' 'weekly ads check,' 'content refresh loop,' 'churn watch,' 'ranking drop alert,' 'run my SEO,' 'SEO operator,' 'daily SEO agent,' 'run my outbound,' 'AI SDR,' 'reply triage,' 'always-on marketing,' 'marketing automation workflow,' or 'run this every week.' Use this to pick, adapt, and schedule an ongoing marketing loop that orchestrates the other marketing skills. For one-off marketing ideas, see marketing-ideas. For the experimentation loop specifically, see ab-testing.

    Also in 10 projects that use this

  • +6 more from Cesarjoquin

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read-only: never INSERT, UPDATE, DELETE, or DROP

    line 152
  2. Very specific:

    Limit results: always add LIMIT 50 to unbounded queries

    line 153
  3. Distinctive:

    Sensitive data: never display passwords, tokens, or PII columns

    line 154
  4. Distinctive:

    Cost: prefer pre-built queries over full table scans

    line 155

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analytics Skill

Query STOA platform data across 5 sources. All queries are read-only.

Data Sources

#SourceAccessAuth
1PostgreSQL (OVH Managed)psql directOpenBao database (DATABASE_URL)
2Token ObservatoryLocal filesNone (filesystem)
3Pushgateway / PrometheusHTTP APINone (IP-whitelisted)
4GitHub CIgh CLIGitHub token (ambient)
5Kuberneteskubectlkubeconfig (ambient)

Connection Patterns

PostgreSQL

DB_URL=$(scripts/lib/stoa-secret.sh database DATABASE_URL)
psql "$DB_URL" -c "<QUERY>"

Fallback (direct):

psql "<POSTGRES_CONNECTION_STRING>"

Token Observatory

# Today's stats
cat ~/.claude/stats-cache.json | python3 -m json.tool

# Historical (metrics.log)
grep "TOKEN-SPEND" ~/.claude/projects/-Users-torpedo-hlfh-repos-stoa/memory/metrics.log

Pushgateway

curl -s https://pushgateway.gostoa.dev/metrics | grep gateway_arena

GitHub CI

gh run list --limit 10 --json name,status,conclusion,startedAt,updatedAt
gh run view <run-id> --log-failed

Kubernetes

kubectl get pods -n stoa-system -o wide
kubectl top pods -n stoa-system

Pre-Built Queries

1. tenant-count — Total tenants

SELECT COUNT(*) AS total_tenants FROM tenants WHERE deleted_at IS NULL;

2. api-count — APIs by tenant

SELECT t.name AS tenant, COUNT(a.id) AS apis
FROM apis a JOIN tenants t ON a.tenant_id = t.id
WHERE a.deleted_at IS NULL
GROUP BY t.name ORDER BY apis DESC;

3. user-count — Active users

SELECT COUNT(*) AS total_users FROM users WHERE is_active = true;

4. gateway-instances — Registered gateways

SELECT name, gateway_type, status, base_url, last_health_check
FROM gateway_instances ORDER BY last_health_check DESC;

5. recent-deployments — Last 10 API deployments

SELECT a.name AS api, d.status, d.gateway_type, d.created_at
FROM deployments d JOIN apis a ON d.api_id = a.id
ORDER BY d.created_at DESC LIMIT 10;

6. subscription-stats — Subscriptions by status

SELECT status, COUNT(*) FROM subscriptions GROUP BY status ORDER BY count DESC;

7. token-cost-7d — Token costs last 7 days

grep "TOKEN-SPEND" ~/.claude/projects/-Users-torpedo-hlfh-repos-stoa/memory/metrics.log | tail -7

8. ci-health — CI pass rate last 20 runs

gh run list --limit 20 --json conclusion | python3 -c "
import json,sys; runs=json.load(sys.stdin)
total=len(runs); ok=sum(1 for r in runs if r['conclusion']=='success')
print(f'{ok}/{total} passed ({100*ok//total}%)')
"

9. arena-scores — Gateway Arena latest scores

curl -s https://pushgateway.gostoa.dev/metrics | grep 'gateway_arena_score{' | sort

10. pod-status — All pods health

kubectl get pods -n stoa-system --no-headers | awk '{print $1, $2, $3}'

11. db-size — Database size

SELECT pg_size_pretty(pg_database_size(current_database())) AS db_size;

12. table-sizes — Top 10 tables by size

SELECT relname AS table, pg_size_pretty(pg_total_relation_size(relid)) AS size
FROM pg_catalog.pg_statio_user_tables
ORDER BY pg_total_relation_size(relid) DESC LIMIT 10;

Usage

User: /analytics tenant-count
User: /analytics How many APIs are deployed on Kong?
User: /analytics token-cost-7d
User: /analytics What's the CI pass rate this week?

For free-form questions, map to the closest pre-built query or compose a custom one.

Rules

  • Read-only: never INSERT, UPDATE, DELETE, or DROP
  • Limit results: always add LIMIT 50 to unbounded queries
  • Sensitive data: never display passwords, tokens, or PII columns
  • Cost: prefer pre-built queries over full table scans

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.