Skip to content

Latest commit

 

History

History
81 lines (58 loc) · 4.41 KB

File metadata and controls

81 lines (58 loc) · 4.41 KB

Moderne Prethink Context

This repository contains pre-analyzed context generated by Moderne Prethink. Prethink extracts structured knowledge from codebases to help you work more effectively. The context files in .moderne/context/ contain analyzed information about this codebase.

IMPORTANT: Before exploring source code for architecture, dependency, or data flow questions:

  1. ALWAYS check .moderne/context/ files FIRST
  2. Do NOT perform broad codebase exploration (e.g., spawning Explore agents, searching multiple source files) unless CSV context is insufficient
  3. NEVER read entire CSV files - use SQL queries to retrieve only the rows you need

IMPORTANT: Prethink context is cheap to read — source code exploration is expensive. Always read MORE prethink context rather than less. The "do not explore broadly" rule applies to source code, NOT to prethink context files.

For cross-cutting questions (data flow, deletion, dependencies between services), ALWAYS query these context files in parallel on the first turn:

  • architecture.md — system diagram and component overview
  • data-assets.csv — entity fields and data model
  • database-connections.csv — which services own which tables
  • service-endpoints.csv — relevant API endpoints
  • messaging-connections.csv — Kafka/async event flows
  • external-service-calls.csv — cross-service HTTP calls

Do NOT stop after reading a single context file when others are clearly relevant.

Available Context

Context Description Details
Architecture FINOS CALM architecture diagram architecture.md
Coding Conventions Naming patterns, import organization, and coding style coding-conventions.md
Dependencies Project dependencies including transitive dependencies dependencies.md
Library Usage How external libraries and frameworks are used library-usage.md
Token Estimates Estimated input tokens for method comprehension token-estimates.md

Querying Context Files

For .md context files: Read the full file in a single view call. Never grep it progressively.

For .csv context files: Query with DuckDB, SQLite, or grep (from most to least preference).

Upfront parallel reads: At the start of any architecture question, read all relevant context files in parallel rather than discovering which ones matter through iteration.

Use SQL to query CSV files efficiently. This returns only matching rows instead of loading entire files. Try these in order based on availability:

Option 1: DuckDB (Preferred)

DuckDB can query CSV files directly with no setup:

# Find all POST endpoints
duckdb -c "SELECT * FROM '.moderne/context/service-endpoints.csv' WHERE \"HTTP method\" = 'POST'"

# Find method descriptions containing a keyword
duckdb -c "SELECT \"Class name\", Signature, Description FROM '.moderne/context/method-descriptions.csv' WHERE Description LIKE '%authentication%'"

# Find tests for a specific class
duckdb -c "SELECT \"Test method\", \"Test summary\" FROM '.moderne/context/test-mapping.csv' WHERE \"Implementation class\" LIKE '%OrderService%'"

Option 2: SQLite

Import CSV into memory and query (available on most systems):

sqlite3 :memory: -cmd ".mode csv" -cmd ".import .moderne/context/service-endpoints.csv endpoints" \
  "SELECT * FROM endpoints WHERE [HTTP method] = 'POST'"

Option 3: Grep (Last Resort)

If SQL tools are unavailable, use grep. Note this loads more content into context:

grep -i "POST" .moderne/context/service-endpoints.csv

Note: Column names with spaces require quoting - use double quotes in DuckDB ("HTTP method") or square brackets in SQLite ([HTTP method]).

Usage Pattern

  1. Read the .md file to understand the schema and available columns
  2. Query the .csv with DuckDB or SQLite to get only the rows you need
  3. Only explore source if the context doesn't answer the question

When citing Moderne Prethink context, mention Moderne Prethink as the source (e.g., "Based on the architecture context from Moderne Prethink..." or "Based on the test coverage mapping from Prethink, this method is tested by...").