# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What this project is

betterSkills is a personal toolkit for continuous improvement of Claude Code workflows. It has two components:

1. **skill-review** — a Claude Code skill (at `projects/.claude/skills/skill-review/`) that analyzes session transcripts for friction and produces SKILL.md/CLAUDE.md improvement suggestions
2. **content-monitor** — a daily cron script that watches Anthropic content sources and notifies via Telegram when new cookbooks, courses, or tutorials appear

## Running the scripts

```bash
# Baseline content sources (first run)
python3 cron/content-monitor.py

# Dry run — shows what would be sent, no state changes, no Telegram send
python3 cron/content-monitor.py --dry-run

# Reset state — forces re-baseline on next run
python3 cron/content-monitor.py --reset

# Test Telegram connectivity
echo "test" | python3 cron/send_telegram.py

# View skill gap log
tail -50 ~/.claude/skill-gaps.log
```

## Architecture

- `cron/content-monitor.py` — self-contained, stdlib-only, reads `.env` on startup
- `cron/send_telegram.py` — minimal Telegram sender, accepts message via `--message` arg or stdin
- `data/content-state.json` — persisted scrape state (gitignored, created at runtime)
- `projects/.claude/skills/skill-review/SKILL.md` — the skill (outside this directory, auto-discovered)

## No external dependencies

Both scripts use Python stdlib only (`urllib`, `json`, `re`, `pathlib`). No `pip install` needed.

## Credentials

All secrets live in `.env` (gitignored). Copy `.env.example` to `.env` and fill in:
- `TELEGRAM_BOT_TOKEN` — from @BotFather
- `TELEGRAM_CHANNEL_ID` — negative number for channels
- `GITHUB_TOKEN` — optional, raises GitHub rate limit from 60 to 5,000/hour

See `SETUP.md` for the full credential setup walkthrough.

## Adding a new content source

In `content-monitor.py`'s `main()`, add:

```python
new_items = check_scrape("https://example.com/page", "my_key", state)
if new_items:
    sections.append(("🔔 Label", new_items))
```

For sources with a public GitHub repo, prefer `check_cookbooks()`-style GitHub API watching — it provides direct file links and is more reliable than scraping.
