Personal Project · Vibe Code · 2026

Weather-based Corn Planting
Predictor — Java, Indonesia

Personal Python Gemini API Vibe coding Prompt engineering Java, Indonesia

A vibe-coded AI tool using Gemini to predict optimal corn planting windows for smallholder farmers in Java, Indonesia — built to explore how accessible AI tooling can support climate-adaptive agricultural decisions without requiring agronomist expertise.

Source code
plaupla / Vibe-code
View on GitHub ↗

Artifact 01 — Domain research & problem framing

The Problem

Java's smallholder corn farmers — predominantly in Central and East Java — face increasing climate unpredictability. Rainy seasons arrive earlier or later than historical averages, and planting too early or too late relative to rainfall onset significantly reduces yield. Agronomist access is limited, and existing weather services don't translate forecast data into planting guidance.

Context
Smallholder farming in Java
Java is one of Indonesia's main corn-producing regions. Most farms are under 2 hectares. Farmers rely on generational knowledge of seasonal planting windows — knowledge increasingly invalidated by climate change.
Gap
No accessible climate-adaptive guidance
National weather agency (BMKG) provides forecasts but not planting recommendations. Agricultural extension services are under-resourced. There is no tool that bridges weather data and planting decisions for a non-specialist user.
Chart showing typical rainy season onset variability in Java from the Indonesian Meteorological Department
Fig 1. Java typical rainy season onset variability from Indonesian Meteorological Department (2026)

Artifact 02 — Process

Process

A research-first vibe coding process — domain understanding before any code, then iterative prompt engineering to get Gemini producing actionable, contextually accurate recommendations.

01
Domain research
Corn agronomy in Java — key climate variables, planting calendar, soil moisture needs
02
Data sourcing
Identified weather data sources: BMKG, Open-Meteo API, historical rainfall datasets
03
Vibe coding
Built Python scaffold using Gemini API — weather data ingestion + prediction output
04
Prompt engineering
Iterated system prompt to ground Gemini in local agronomic context and produce farmer-readable output
05
Validation
Cross-checked recommendations against published BPTP planting calendars for Central Java

Artifact 03 — Prompt engineering

Prompt Design

Getting Gemini to produce genuinely useful planting advice required grounding it in local agronomic context — not just passing raw weather data. The system prompt evolved across several iterations.

System prompt — iteration 1 (too generic)
"You are an agricultural assistant. Given weather forecast data, advise on the best time to plant corn."
System prompt — iteration 3 (contextualised)
"You are an agricultural advisor for smallholder corn farmers in Java, Indonesia. Given a 14-day weather forecast for a specific regency, advise on optimal planting windows. Consider: rainfall onset (>10mm/day for 3 consecutive days signals monsoon onset), soil moisture recovery time, and the risk of planting into a dry spell. Output must be in plain language suitable for a farmer without agronomy training. Provide a recommended planting window, a risk level (low / medium / high), and one sentence of reasoning."
Screenshot of Python code ingesting weather data and calling the Gemini API
Fig 2a. Python code snippet
Screenshot of Gemini output predicting corn planting timing based on weather data
Fig 2b. Sample Gemini output — planting window recommendation

Artifact 04 — Insights

Key Learnings

01
Context in the system prompt matters more than the model
Generic prompts produced generic advice. Local agronomic context — monsoon onset thresholds, crop stage sensitivity — was what made the output actionable rather than obvious.
02
Farmer-readable output is a design problem, not a model problem
Gemini could produce technically accurate recommendations — but "14-day precipitation accumulation exceeds 80mm" isn't useful to a farmer. Output format is a UX decision that lives in the prompt.
03
Validation against domain standards is essential
Cross-checking against BPTP (agricultural technology assessment institute) planting calendars revealed that Gemini's recommendations aligned well for normal seasons but diverged on anomalous rainfall years — a real limitation.
04
The real barrier is last-mile delivery, not prediction accuracy
A technically accurate planting predictor is only useful if a farmer can access it. Smartphone penetration in rural Java is growing but data costs remain a barrier. SMS delivery or WhatsApp integration would likely have more reach than a web app.