How to add or modify fetch and scrape pipeline stages in SourceMonitor. Use when working on FeedFetcher, EntryProcessor, ItemCreator, completion handlers, or adding new processing steps to the feed ingestion pipeline.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
How to add or modify fetch and scrape pipeline stages in SourceMonitor. Use when working on FeedFetcher, EntryProcessor, ItemCreator, completion handlers, or adding new processing steps to the feed ingestion pipeline.
allowed-tools
Read, Write, Edit, Bash, Glob, Grep
SourceMonitor Pipeline Stage Development
Overview
The SourceMonitor fetch pipeline transforms RSS/Atom/JSON feeds into persisted Item records. The pipeline has two main phases: fetching (HTTP + parsing) and item processing (entry parsing + content extraction + persistence).
# In FetchRunner#initialize, add parameter:definitialize(source:, ..., my_handler:nil)
@my_handler = my_handler || Completion::MyHandler.new
end
Step 3: Call it in FetchRunner#run (inside the lock block):
defrun
lock.with_lock do
mark_fetching!
result = fetcher_class.new(source: source).call
retention_handler.call(source:, result:)
follow_up_handler.call(source:, result:)
my_handler.call(source:, result:) # <-- Add here
schedule_retry_if_needed(result)
mark_complete!(result)
end
event_publisher.call(source:, result:)
result
end
Option 2: Add an Entry Processor Hook
Use SourceMonitor::Events.run_item_processors to add per-item processing without modifying the pipeline core.
# In an initializer or engine setup:SourceMonitor.configure do |config|
config.events.on_item_processed do |source:, entry:, result:|
# Custom per-item logicendend
Option 3: Add an EntryParser Extension
To extract new fields from feed entries, extend EntryParser:
# Add a new extract method to EntryParserdefextract_my_fieldreturnunless entry.respond_to?(:my_field)
string_or_nil(entry.my_field)
end