Skip to content
vp.Ven Petrov
WorkWritingAboutAt a glance
← Projects & notes
ctxforgeProject story · 4 min read

ctxforge: discovering what to build before coding

A context discovery framework that asks an LLM to act like a senior engineering interviewer: understand the idea, uncover requirements and agree the scope before an agent starts building.

Ven PetrovPublic toolkitOpen project

An LLM has a broad store of engineering knowledge. I wanted to use that knowledge earlier in a project, when an idea still needs to become a clear set of requirements.

The idea behind ctxforge is to have the model act like a senior engineer interviewing the person with the idea. It should ask relevant questions, uncover constraints and help define the scope. That gives a coding agent a specific task to carry out, with a boundary around features that haven't been requested.

ctxforge is the public experimental toolkit I built around that process. A Node command-line installer adds editable Markdown instructions and project notes to a repository.

Turn an idea into decisions

The questions follow the work. For a new project, the entry document asks about its vision, technical foundation and the first thing a user should be able to do. That starts the conversation; a task-specific protocol then asks for more detail.

The README uses “Add search functionality” as a teaching example. It asks which data should be searchable, how many items there are, what matching is needed, when results should appear and what response time is acceptable. Accessibility is part of the discussion too.

Those answers connect the product need to the technical choices. Searching a small list of names on demand creates different requirements from searching a large catalogue while someone types, including misspellings.

The intended output is an agreed task: what the person needs, what behavior will count as working and which decisions are still open. The point of the interview is to discover that context before implementation makes assumptions expensive to unwind.

For a bug, the questions change. The core document's duplicate-search example asks how to reproduce the behavior and whether it happens consistently or intermittently. It routes the assistant toward investigation instead of treating the request as a new feature.

These are examples in the repository, not client incidents or measured results.

Make the proposed scope reviewable

The core instruction is short:

Make ALL technical assumptions explicit
Show confidence levels (HIGH/MEDIUM/LOW)
Present inferences BEFORE writing any code
Wait for human approval/correction

This is an excerpt from CORE.md. After asking, the assistant should explain what it inferred before writing code. A suggestion about storage, matching behavior or an error case can then be corrected while it is still a proposal.

The confidence words make assumptions easier to inspect. They aren't probabilities and don't make an inference correct. The human still decides whether the proposed task matches the idea.

Load the questions for the current task

  1. 01CORE.mdIdentify the request type
  2. 02One protocolRead its discovery questions
  3. 03AssumptionsShow confidence and unresolved choices
  4. 04project.mdSave decisions for the next session
The CLI installs the documents. Their routing and questioning rules are instructions for the assistant, not enforced runtime controls.

Keep the task available as work continues

The toolkit installs six core documents and 16 task protocols. One entry document selects the relevant protocol, so the assistant doesn't need to load every workflow for every task.

Project decisions and learnings live in project.md. Its initial structure records the vision, stack, current focus and next task. The initializer leaves an existing copy alone. After a task, the instructions ask for a state snapshot: what changed, what is current and what a later session needs to know.

That saved state supports the discovery goal: a later session has somewhere to recover the project and current task. Old discussion can move out of the active context while relevant decisions remain available. Reload instructions return to the core protocol, project state and quality directives.

I also had to make this purpose clearer in the README. Programmers I showed the work to didn't fully understand its explanation, and I asked for simpler examples without inflated claims.

The public result is an editable framework that can be inspected and tried. It gives teams a way to discuss requirements and scope with an LLM before handing work to a coding agent. The CLI installs instructions; it doesn't enforce the scope or guarantee model behavior. I haven't established a controlled reduction in mistakes, delivery time or token use.

Project sources & checks
Original README feedback

The user says skilled programmers shown the work did not fully understand the README, and asks for clearer examples without bragging.

Public implementation ↗

Version 3.1.2 contains the Node initializer, six core documents and 16 task protocols. CORE.md defines questioning, intent routing, explicit assumptions, project snapshots and reload instructions.

Protocol excerpt ↗

The excerpt below is from CORE.md. Search and duplicate-result examples are repository teaching examples, not reported production incidents or benchmark results.

Related context-design exchange

In a separate narrative-agent research conversation, the user challenges the basis for a 1,500-token budget and four calls per day. The assistant admits those were estimates and revises the document toward configurable starting values.

Evaluation scope

An implemented experimental toolkit and existing CLI checks, without a controlled productivity, token-saving or hallucination-reduction benchmark.

On this page
Turn an idea into decisionsMake the proposed scope reviewableKeep the task available as work continuesSources & checks
LLMsContext engineeringNode.jsOpen source

Connected to this

All writing
Between Us · Project story

Between Us: why I kept the first take and widened the shot

Restaurant-service voice agent · Experiment

Designing a restaurant-service call around the real offer

Ven PetrovSoftware engineer · Barcelona
GitHub ↗LinkedIn ↗Email ↗

Find a project or a note

17 results

Transfutur ERP · ExperienceERP for transport and logisticsAs the sole engineer, I built an ERP from zero for transport and logistics. It supported roughly €5–6 million in annual invoicing across two offices, and I kept it running for about a year.Financial review lab · Project storyExploring a financial report with Python and FastAPII started with one income change, then opened up the same 54-page report: products, regions, cash flow, core adjustments and a dataset whose figures lead back to the source.Crude-oil narrative tracker · Project storyCrude-oil research from global news and market dataI wanted help following global events that could matter for crude oil. The prototype combines news research with calculated market and position values, while keeping recent assessments separate from the longer numeric history.MNQ time-series research · ExperimentTime-series prediction experimentsAn exploration of high-resolution market data: choosing what to acquire, checking its limits, comparing time intervals and testing whether a prediction survived later data and the cost of acting on it.NQ/MNQ backtest engine · Technical noteA missing closing bar left the simulator’s short position openThe strategy reset for a new day while a shared counter still counted yesterday’s short. A small replay shows why closing the position has to happen before clearing its state.Small-cap edge research · Project storyTurning small-cap trading ideas into repeatable researchI asked Claude Code for a fresh research system that could test named price patterns, compare later periods and carry its methodology into new sessions. One candidate shows how features, entry timing and costs fit together.Gadgeon Europe applications · ExperienceConnected-device dashboards and mobile apps at Gadgeon EuropeI worked on Ionic and Angular applications that brought several APIs into dashboards for energy monitoring and connected-device control, with releases and maintenance across multiple client versions.ctxforge · Project storyctxforge: discovering what to build before codingA context discovery framework that asks an LLM to act like a senior engineering interviewer: understand the idea, uncover requirements and agree the scope before an agent starts building.Sociedades Inactivas enquiries · Technical noteSaving an enquiry before trying to send its emailOn the Sociedades Inactivas catalogue, a visitor can ask about a company or send a general enquiry. The form separates saving that request from delivering its notification, including when the visitor retries.Astro local-services website · Project storyA local-services site assembled from city, service and FAQ recordsThe Astro site describes flooring and other local services across different cities. Shared templates check availability, read the matching content and select one FAQ set for both visitors and structured data.3D Spaces website migration · Project storyMoving 3D Spaces to Next.js while its email stayed on the old serverI rebuilt the virtual-tour website with AI coding collaborators, preserving its content and URLs. The cutover also had to protect the mailbox, enquiry flow and existing analytics history.Capture CRM · Project storyConnecting classified listings to contacts in a small CRMA Chrome extension and Next.js dashboard bring classified listings, platform profiles and contact history together. Saving a listing again can add the person who was missing from an earlier import.Product-description comparison bench · ExperimentComparing one model call with separate vision and writing stepsA small product-description tool lets me inspect the visual analysis before the copy is written, change the model used for each step and compare request measurements.Between Us · Project storyBetween Us: why I kept the first take and widened the shotI compared dialogue takes, asked for wider shots and more physical acting, then changed the workflow when its studio limited the scenes I wanted to make.Restaurant-service voice agent · ExperimentDesigning a restaurant-service call around the real offerI worked through a Spanish outbound agent prompt, corrected a free visit to the actual paid service and compared how two drafts handled transfers and bookings.Vapi and Telnyx voice integration · Technical noteThe Vapi agent could speak, but it could not hear me clearlyMy Telnyx number connected to the assistant, but the caller audio was distorted. Three codec tests recovered the connection without fixing that original problem.Warloop: Echoes of Solmara · Project storyWarloop: turning generated character art into a playable prototypeGood-looking character images became tiny figures, a backwards walk and misplaced bosses in the game. I worked through the gap between generated art and playable behavior.
esc to close · Tab to move through results