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--dateis omitted. - Agent can choose layout/order at call time:
python skills/milan-news-briefing/scripts/run_briefing.py --layout editorial --section-order weather,strikes,ai_news,world_news,italian_news,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/manage_sources.py listpython skills/milan-news-briefing/scripts/manage_sources.py --json list - Add RSS source:
python skills/milan-news-briefing/scripts/manage_sources.py add --section ai_news --name "Example AI" --type rss --url "https://example.com/rss.xml" - Add JSON API source with parser:
python skills/milan-news-briefing/scripts/manage_sources.py add --section strikes --name "Strike API" --type json --url "https://example.com/strikes" --parser italy_transport_strikes_v1 - Add HTML source (for parser using webpage table):
python skills/milan-news-briefing/scripts/manage_sources.py add --section strikes --name "Strike HTML" --type html --url "https://example.com/strikes-page" --parser italy_mit_strikes_html_v1 - Remove source by exact name:
python skills/milan-news-briefing/scripts/manage_sources.py remove --section world_news --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/manage_cron.py install --hour 7 --minute 0python skills/milan-news-briefing/scripts/manage_cron.py install --hour 7 --minute 0 --timezone Europe/Romepython 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/manage_cron.py showpython skills/milan-news-briefing/scripts/manage_cron.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.yamlas source-of-truth. - Keep strike source URL non-empty if real strike monitoring is required.
- Keep per-section
countat 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 payloadtailfor quick triage. - Use
--auto-degradein production cron to bypass temporary source outages. - Prefer
--jsonflags 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.pyparser maps. - Reference parser key in
config/sources.yamlsource item.
Read references/source_schema.md before adding JSON-based sources.