Design a reusable housing-search skill

You are creating an agentic solution to search for rental houses in the Netherlands. The orchestrator below is already defined in Listing 1.

Listing 1: Orchestrator: delegate each offer check, then select matches and send one summary.
Input: Path, Criteria, Email
Output: One email
Start
    Set Websites to Call Read Sites(Path)
    Set Matches to an empty list
    For each Website in Websites
        Set Offers to Call Get Offers(Website)
        For each Offer in Offers
            Set Accepted to Call Check Offer(
                Offer, Criteria)
            If Accepted is Yes Then
                Append Offer to Matches
            End If
        End For
    End For
    Set Selected to Call Select Three(Matches)
    Call Send Summary(Email, Selected)
End
  1. Implement the real estate agent’s Check Offer(Offer, Criteria) in pseudocode or a flowchart. Its two inputs are:

    • Offer: one house record containing its city, monthly rent in euros, area in square meters, and webpage URL.
    • Criteria: the required city, maximum monthly rent, and minimum area.

    Return Yes only when all three rules hold:

    1. The offer’s city matches the required city.
    2. Its rent is at most the maximum monthly rent.
    3. Its area is at least the minimum area.

    Otherwise, return No. Rent and area equal to their limits are accepted. Leave both inputs unchanged.

The orchestrator receives a text-file path (Path), the student’s email address (Email), and Criteria. Assume valid inputs and successful operations. Every offer is currently available and appears once across all websites.

NoteSupplied operations

These operations are already defined.

  1. Read Sites(Path) reads website addresses from the text file. It returns a list in line order, trims spaces, skips blank lines, and closes the file without changing it. An empty file returns an empty list.
  2. Get Offers(Website) retrieves today’s available offers from one website address. It returns offer records in listing order without changing the website. A website with no offers returns an empty list.
  3. Select Three(Matches) receives a list of matching offers and returns a new list of up to three offers ordered by lowest rent. Equal rents keep encounter order. It leaves the input unchanged; an empty list gives an empty list.
  4. Send Summary(Email, Selected) receives an email address and a list of selected offers. It sends one summary email containing each offer’s city, rent, area, and URL in list order. With an empty list, the summary says No matching houses found. It returns no value and leaves the list unchanged.
NoteExample

Listing 2 shows the website file sites.txt.

Listing 2: Website file with two fictional addresses, searched in line order.
https://one.example
https://two.example
  • Read Sites("sites.txt") returns the two addresses in file order.
  • Get Offers("https://one.example") returns A01, A02, and A03 from Table 1, in that order.
  • Select Three([A01, B01]) returns B01 then A01 because B01 has lower rent.
  • Send Summary("student@example.test", []) sends one email saying No matching houses found.
  1. For city Enschede, maximum monthly rent 1000 euros, and minimum area 40 m², use the offers in Table 1. Which three houses will appear in the email, and in what order? Briefly justify your selection.
Table 1: Today’s available fictional offers in website and listing order. Each URL is the site address + /houses/ + label, e.g. https://one.example/houses/A01.
Site House City Rent (EUR/month) Area (m²)
1 A01 Enschede 900 50
1 A02 Enschede 1000 40
1 A03 Enschede 850 35
2 B01 Enschede 800 45
2 B02 Utrecht 700 70
2 B03 Enschede 850 55

A skill stores reusable instructions for a task. An AI agent follows instructions and uses available tools. The orchestrator coordinates the search through nested loops over websites and offers; the real estate agent checks individual offers. Each role is a named procedure with explicit inputs and outputs.

A handoff delegates one offer check. The orchestrator passes the offer and criteria to the real estate agent and receives its Yes or No decision. The supplied version waits for that decision before checking the next offer.

In agentic programming, a developer uses an AI coding agent to draft a design, test it, inspect the results, and revise it. The resulting skill can be reused with another website file or different criteria.