Next steps (handoff for new chat)

Continuation guide after the Lib DRY extraction and AI readability documentation work. Start a new chat with: β€œContinue from docs/NEXT_STEPS.md” and point the agent at this file.

Completed (do not redo)

DRY shared libs (code)

Migrated callers: catalogue trio (auslib/qldlibrary/qldmuseum), cursor agents, directchat wire/session/dcc, TextUtil sweep across search/report modules.

AI readability docs (no code changes)

Large file splits (Priority 1 β€” done)

Priority 1 large-file splits are complete. Priority 2 lib subdirectories are complete. Priority 3 module headers in progress (cluster batches done; ~143 flat libs remain).

Theme plugin migration (S0–S12 done; phase 2 S13+)

Sprint backlog and plugin inventory: docs/THEME_MIGRATION.md.

Done (S0–S12): ThemeOutput, FloodSafeTheme, ThemePaintRules, ~96 PaintSamples, runtime wiring on ~90 plugins, progress gutter (MessageProgress, FloodSafe :auto, ReplyLayout).

Phase 2 (S13+): Clock cluster shims, irc_ping_ms for progress digit 3, replace stub samples (S4–S11) with real formatter output, colon alignment, optional progress theming and ThemeFrame doodles. See S13+ sprint table in THEME_MIGRATION.md.


Priority 1 β€” Large file splits (remaining)

All items done β€” see list above.


Priority 2 β€” Lib subdirectories (complete)

Prefix clusters moved into folders; re-export shims remain at old paths. Do not edit lib/vendor/.

Done


Priority 3 β€” Module headers (cheap, incremental)

When touching any lib file, add a standard header:

# frozen_string_literal: true

# ModuleName β€” one-line purpose.
# Public: method_a, method_b
# Depends: OtherModule, rabbot_http
# Tests: test/lib/module_test.rb

Apply first to domains in Priority 1 splits and any new code.

Progress (module headers)


Priority 4 β€” Remaining DRY (low priority)

Only if touching these areas anyway:

Area Files Extraction idea
Transit Delay Derby govau_derby.rb, govau_tfnsw_derby.rb Shared bet parsing + peak-hour gate; keep city-specific API fields
Cursor stream questions cursor_agent_output.rb StreamParser Reuse CursorAgentQuestions.extract_from_event for plan-mode hook
Town/event reports whatson_report, theatres_report, car_report Already use TextUtil.title_words; optional thin TownReport for empty-state cards only if a 4th copy appears
AI plan pending CRUD ai_plan_session, rabbot_meta_plan_session Generic plugin JSON CRUD β€” low value (only 2 callers)
CKAN fetch govau_ckan, qldmuseum_search Different endpoints; share TextUtil.squish only (done)

Note: lib/directchat_mirc_inventory.rb popup_item_line? intentionally differs from lib/directchat_mirc_parse.rb β€” do not unify without comparing tests.


Priority 5 β€” Documentation maintenance


Priority 6 β€” Optional tooling


Suggested order for a new session

  1. Apply Priority 3 module headers when touching flat libs under lib/.

  2. Update LIB_INDEX.md when paths change.

  3. Run the relevant test suite for the area you change.


Key references for the agent

Doc Use when
AGENTS.md Orienting in the repo
lib/CONVENTIONS.md IRC style, shared libs, plugin checklist
lib/CONTRACTS.md Changing return hashes
lib/LIB_INDEX.md Finding which lib owns a domain
docs/architecture.md Build / AI / directchat flows

Scope choices from prior planning