Run the briefing pipeline and manage sources with deterministic scripts.
Execute Daily Brief
- Ensure dependencies are installed:
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
- Generate report:
python -m src.news_briefing.main
- Use dry run for debugging:
python -m src.news_briefing.main --dry-run
- Default report date follows config timezone (
Europe/Rome) when --date is omitted.
- Agent can choose layout/order at call time:
python skills/milan-news-briefing/scripts/runbriefing.py --layout editorial --section-order weather,strikes,ainews,worldnews,italiannews,milan_events
- Agent can request JSON output for post-processing:
python skills/milan-news-briefing/scripts/run_briefing.py --output-format json
Manage Source Pipelines
Use scripts/manage_sources.py in this skill folder.
- List configured sources:
python skills/milan-news-briefing/scripts/managesources.py list python skills/milan-news-briefing/scripts/managesources.py --json list
- Add RSS source:
python skills/milan-news-briefing/scripts/managesources.py add --section ainews --name "Example AI" --type rss --url "https://example.com/rss.xml"
- Add JSON API source with parser:
python skills/milan-news-briefing/scripts/managesources.py add --section strikes --name "Strike API" --type json --url "https://example.com/strikes" --parser italytransportstrikesv1
- Add HTML source (for parser using webpage table):
python skills/milan-news-briefing/scripts/managesources.py add --section strikes --name "Strike HTML" --type html --url "https://example.com/strikes-page" --parser italymitstrikeshtml_v1
- Remove source by exact name:
python skills/milan-news-briefing/scripts/managesources.py remove --section worldnews --name "BBC World"
Daily Ops
Use scripts/daily_ops.py for daily automation.
- Run once with precheck + auto degrade + retry:
python skills/milan-news-briefing/scripts/daily_ops.py --auto-degrade --max-retries 2 --retry-delay 120
- Run once and send fail alert:
python skills/milan-news-briefing/scripts/daily_ops.py --auto-degrade --alert-webhook "https://example.com/webhook"
- Print cron line (7:00 daily):
python skills/milan-news-briefing/scripts/daily_ops.py --print-cron --cron-hour 7 --cron-minute 0
- Optional success alert:
python skills/milan-news-briefing/scripts/daily_ops.py --alert-webhook "https://example.com/webhook" --alert-success
- Skip precheck explicitly (not recommended):
python skills/milan-news-briefing/scripts/daily_ops.py --skip-precheck
Cron Scheduling
Use scripts/manage_cron.py to manage one tagged cron entry.
- Install/replace 07:00 daily run:
python skills/milan-news-briefing/scripts/managecron.py install --hour 7 --minute 0 python skills/milan-news-briefing/scripts/managecron.py install --hour 7 --minute 0 --timezone Europe/Rome python skills/milan-news-briefing/scripts/manage_cron.py install --hour 7 --minute 0 --timezone Europe/Rome --layout editorial --output-format markdown
- Install with webhook:
python skills/milan-news-briefing/scripts/manage_cron.py install --hour 7 --minute 0 --webhook "https://example.com/webhook"
- Show current managed entry:
python skills/milan-news-briefing/scripts/managecron.py show python skills/milan-news-briefing/scripts/managecron.py --json show
- Remove managed entry:
python skills/milan-news-briefing/scripts/manage_cron.py remove
Health Check And Validation
- Check all configured sources:
python skills/milan-news-briefing/scripts/check_feeds.py --timeout 12 --write-report output/logs/feed-health.json
- Validate full stack locally:
python skills/milan-news-briefing/scripts/validate_stack.py --skip-network
- Validate with network checks:
python skills/milan-news-briefing/scripts/validate_stack.py
Operate Safely
- Keep configuration in
config/sources.yaml as source-of-truth.
- Keep strike source URL non-empty if real strike monitoring is required.
- Keep per-section
count at 5 for stable daily format unless user asks otherwise.
- Preserve SQLite database
data/briefing.db; do not clear it unless user asks to reset dedup history.
- Check
output/logs/ after failures and use webhook payload tail for quick triage.
- Use
--auto-degrade in production cron to bypass temporary source outages.
- Prefer
--json flags on management scripts when an agent needs machine-readable state.
Extend Parsers
- Add parser logic in
src/news_briefing/parse.py.
- Register parser in
src/news_briefing/pipeline.py parser maps.
- Reference parser key in
config/sources.yaml source item.
Read references/source_schema.md before adding JSON-based sources.