DEV Community

Khe Ai
Khe Ai Subscriber

Posted on

Self-Healing Dev Bounty Hunter with OpenClaw in Action

OpenClaw Challenge Submission 🦞

This is a submission for the OpenClaw Challenge.

What I Built

The traditional developer career path is making way for the "Digital Hermit"—engineers who reject the 9-to-5 in favor of high-leverage, project-based autonomy. We don't have bosses; we have targets. We earn our income by winning competitive hackathons and high-stakes coding bounties.

The problem? The "Bounty Hunter" lifestyle requires hours of unbillable, soul-crushing manual labor to discover high-yield, low-competition challenges scattered across a fragmented digital wasteland (Dev.to, Gitcoin, HackerNews, niche Layer-1 forums). Traditional scrapers break constantly, and most aggregators are filled with expired noise.

To solve this, I built KheAi Dev Hunter—an autonomous Agent-as-a-Service (AaaS) that treats the search for developer prizes like a high-frequency trading desk.

kheai dev hunter

I designed KheAi Dev Hunter as a sleek, Local-First Markdown System living directly on my machine (or VPS). It autonomously scouts the web, extracts bounty data, normalizes currencies, deduplicates entries, and updates a clean set of local Markdown files (ongoing_dev.md, incoming_dev.md) so I wake up every morning to a curated list of high-value targets.

(Note: While the core agent operates entirely locally on Markdown for maximum control, I also built in an optional secret-key webhook payload for developers who want to push the final curated data to a traditional Meteor/MongoDB web dashboard).

How I Used OpenClaw

Instead of building a dozen brittle custom scrapers, I used OpenClaw as the central nervous system and reasoning engine of the platform.

god prompt

I created a custom local skill (skills/kheai-hunter) powered by what I call the "God Prompt"—a master instruction set utilizing OpenClaw's web_search, web_browse, file_read, and file_write tools.

Here is how OpenClaw drives the workflow:

  1. Phase 0 (Meta-Learning): OpenClaw performs a "Global Scout" via search to discover new hackathon platforms I haven't even heard of, validating and appending them to a local sources.json file.
  2. Phase 1 & 2 (Ingestion & The Forge): OpenClaw navigates the source URLs. I use Gemini Search / Model Provider as the ingestion layer to strip out DOM noise and deliver clean Markdown to OpenClaw. OpenClaw then uses Gemini as its reasoning engine to read the context, extracting the Title, Prize, Deadline, and Tech Stack.
  3. Phase 3 (The Filter): OpenClaw cross-references new findings with its local memory (kheai_ledger.json). To prevent file corruption during power failures or crashes, I instructed the agent to use Atomic Writes—writing first to ledger_temp.json, verifying it, and then overwriting the main ledger.
  4. Phase 4 (The Investigator): OpenClaw manages my Markdown files. It moves expired bounties to expired_dev.md and formats new, high-value discoveries (>$100, >7 days away) into a clean list in ongoing_dev.md.

To run this entirely on autopilot, I wrapped the OpenClaw execution (openclaw run --skill kheai-hunter --prompt "Run Daily Hunt") in a bash script triggered by a daily cronjob.

PS: The Step-by-Step Implementation Tutorial Guide: Zero to Hero (includes the full God Prompt) is available at the bottom.

Demo

What I Learned

Building an autonomous agent isn't just about the code; it’s about managing the "surprises" of the web.

daily ingestion

1. LLMs Crush CSS Selectors (The Scraper’s Armor)

Traditional scrapers (Puppeteer/Cheerio) are brittle; they break the moment a site swaps a <div> for a <section>. By passing raw text to OpenClaw, the agent "self-heals" because an LLM understands the intent of a page regardless of the markup.

  • The Surprise: Even with "smart" reading, many high-value targets (like Gitcoin or Devpost) use heavy bot-protection (Cloudflare/Akamai) that blocks standard headless browsers.
  • The Fix: I configured OpenClaw to use Gemini (and SearXNG soon) as its primary ingestion engine. Instead of fighting with DOM trees, Gemini bypasses the scraping-shield and delivers a clean Markdown version of the page. This reduces noise by 80% and ensures the LLM is only processing the "meat" of the bounty description.

2. The "Soft" Deadline Nightmare (The ISO-8601 Enforcer)

Hackathons love vague timelines like "End of Q3," "Rolling submissions," or the dreaded "Soon."

  • The Challenge: If I let the agent guess, I’d end up with a calendar full of ghost dates. Accuracy is the difference between a $10k win and a week of wasted effort on a closed project.
  • The Fix: I implemented a strict Date Normalization rule in the Forge. The agent is instructed to convert every deadline into a hard ISO-8601 string (YYYY-MM-DD). If the LLM identifies a "Rolling" or "Vague" deadline, it is forbidden from hallucinating a date. Instead, it triggers a "Hard-Date-Missing" flag and shunts the entry into pending_review.md for me to check manually.

3. The Oracle Problem (Crypto vs. Fiat)

Parsing prize pools is a nightmare because the industry doesn't speak a single currency. A "50,000 OP" (Optimism) prize might be worth USD 150,000 one day and USD 90,000 the next.

  • The Surprise: My initial filtering logic (Prizes >= $100) was failing because the agent didn't know if "500 USDC" was more or less than "0.5 ETH." It was either ignoring massive crypto prizes or letting "dust" bounties through.
  • The Fix: I forced the agent to act as a financial oracle. During the Forge Phase, it must separate the Native Token Amount from the Estimated USD Value. I provided a "Snapshot Rate" in the prompt for major tokens (ETH, SOL, OP) so the agent can perform a rough float conversion. This keeps the $100 threshold consistent across both fiat and web3 targets.

4. The Hidden Cost of "Raw DOM" (Token Bloat)

Passing raw text to an LLM sounds elegant until your agent hits a modern React or Next.js site. I quickly learned that "raw DOM" often includes 10,000 lines of inline SVGs, base64-encoded images, and massive stringified JSON hydration scripts.

  • The Surprise: My agent was burning through my context window (and API credits) just reading garbage markup, causing the LLM to "forget" its core instructions.
  • The Fix: I had to introduce a lightweight pre-processing step. Before handing the text to the "God Prompt," a basic script strips out all <script>, <style>, and <svg> tags. Clean data in, smart extraction out.

5. Distinguishing a Bounty from a Blog Post

LLMs are brilliant at reading, but they can be incredibly gullible out of the box.

  • The Challenge: The agent would frequently scrape a company's engineering blog that was recapping a hackathon from last year. Because the post mentioned "First Prize: USD 5,000" and a date, the agent cheerfully hallucinated that it was a live opportunity. It also struggled to separate actual coding bounties from "Fill out our developer survey for a chance to win a USD 50 gift card."
  • The Fix: I had to update Phase 2 (The Forge) with strict negative constraints: "If the text implies a recap, a past event, or a random lottery/survey, discard it immediately. The opportunity MUST require the submission of software code."

6. The 4:00 AM Fingerprint

  • The Challenge: In Step 5, I set the cronjob to run at exactly 4:00 AM every day. I thought a 2-second polite delay between requests was enough to stay under the radar. But hitting a target platform at exactly 4:00:00 AM, down to the millisecond, 30 days in a row is the ultimate bot fingerprint. WAFs (Web Application Firewalls) eventually caught on and started blocking my server's IP.
  • The Fix: I had to introduce "Jitter" to my bash script. By adding a simple random sleep command (sleep $((RANDOM % 3600))) before OpenClaw executes, the agent now wakes up naturally at a random time between 4:00 AM and 5:00 AM.

7. JSON Corruption (The "Half-Written" Brain)

  • The Surprise: Because the agent is operating autonomously on a RPi, things happen. A network timeout or a random server restart occurred right in the middle of OpenClaw writing the new URLs to kheai_ledger.json.
  • The Challenge: It wrote half the JSON object and crashed, corrupting the entire memory file. The next day, the agent woke up, couldn't parse its own brain, and threw a fatal error.
  • The Fix: Always use atomic writes. Instead of writing directly to the live ledger, the agent now writes to a temporary file (ledger_temp.json) and then swiftly overwrites the main file once the write is 100% complete and validated.

Step-by-Step Implementation: Zero to Hero

If you want to build this yourself, here is the exact workflow to set up your own autonomous bounty hunter.

Step 1: Prepare the Hunting Ground (Workspace)

First, we need to have a dedicated folder on your computer (or VPS) where the agent will live and work.

Open your terminal or command prompt.

Navigate into it:

   cd ~/.openclaw/workspace
Enter fullscreen mode Exit fullscreen mode

Step 2: Initialize the Agent's "Brain" (State Files)

Your agent needs empty files to start reading and writing. Let's create the JSON memory files and your new Markdown reporting files.

Run these commands in your terminal to create the blank files:

# Memory & Logic Files
touch kheai_ledger.json sources.json discovery_log.txt error_log.txt

# Delivery (Markdown) Files
touch incoming_dev.md ongoing_dev.md expired_dev.md pending_review.md
Enter fullscreen mode Exit fullscreen mode

Note: Open sources.json in a text editor and add at least one starting URL so it isn't completely empty, like ["https://devpost.com/hackathons", "https://dev.to/challenges"].

echo '["https://devpost.com/hackathons", "https://dev.to/challenges"]' > sources.json
Enter fullscreen mode Exit fullscreen mode

Ensure your other state files are initialized so the agent doesn't error out when trying to write to them:

echo "[]" > kheai_ledger.json
Enter fullscreen mode Exit fullscreen mode

Verify File Permissions Make sure the directory where these files live is writable by the process running OpenClaw. If you are on a VPS, ensure your user owns the folder:

chmod 644 sources.json kheai_ledger.json
Enter fullscreen mode Exit fullscreen mode

Step 3: Configure OpenClaw with the "God Prompt"

In OpenClaw, you will create a new Agent/Skill and paste this prompt. This version is heavily optimized to manage our Markdown files and perform its own housekeeping.

Copy and Paste into your OpenClaw Chat

OpenClaw is designed to be recursive—it can often configure its own environment. If your agent has the Coding Agent or File System skill enabled, you can simply "talk" the skill into existence.

I want to add a new local skill. Please create a directory named skills/kheai-hunter and save the following instructions into a file named skill.md inside it. Then, initialize the JSON and MD files mentioned in the prompt.

**Identity & Mission:**
You are the **KheAi Autonomous Hunter**, an Agent-as-a-Service (AaaS). Your mission is to autonomously discover, extract, normalize, and organize high-value online coding challenges, bounties, and hackathons into local Markdown files.

**Operating Files (Persistent State):**
You have access to the following local files. You MUST use your file read/write tools to interact with them:
1. `kheai_ledger.json`: Stores URLs of challenges already found to prevent duplicates.
2. `sources.json`: Your dynamic list of URLs to scrape.
3. `discovery_log.txt`: Records new platforms found, rejected sites, and errors.
4. `incoming_dev.md`: New, standard-value challenges you discover.
5. `ongoing_dev.md`: High-value challenges ($100+ prize and >7 days away).
6. `expired_dev.md`: Challenges where the deadline has passed.
7. `pending_review.md`: Challenges where prize or deadline is missing.

**Phase 0: The Autonomous Discovery (Dynamic Routing)**
- **Trigger:** When commanded to "Run Global Scout".
- **Action:** Search the web for queries like: "online dev challenges," "new hackathon platforms 2026," "active developer bounties," and "web3 grant programs."
- **Evaluation:** Visit discovered URLs. If they have clear deadlines/prizes and are legitimate, append them to `sources.json`. Log the action in `discovery_log.txt`.

**Phase 1: The Daily Hunt (Data Ingestion)**
- **Trigger:** When commanded to "Run Daily Hunt".
- **Action:** Iterate through URLs in `sources.json`. Read the content.
- **Maintenance:** If a source fails 3 times, log it in `error_log.txt` and remove it from the active rotation.

**Phase 2: The Forge (Extraction & Normalization)**
- **Action:** Extract findings into this mental schema: Title, Prize (USD), Deadline (ISO 8601), Tech Stack, Difficulty, Source URL.
- **Logic:** If prize or deadline is missing, mark as "Pending Review" and append to a new file `pending_review.md`. Do not guess.

**Phase 3: The Filter (Deduplication)**
- **Action:** Read `kheai_ledger.json`. If a extracted `source_url` or semantic title already exists, discard the new item. If it is new, add the URL to `kheai_ledger.json`.

**Phase 4: The Investigator (Markdown Management)**
- **Trigger:** When commanded to "Run Investigator".
- **Action:** Read `pending_review.md`. For every entry with "Unknown" details, visit the Source URL, extract the missing information (Prize, Deadline, Tech Stack), and update the entry.
- **Normalization:** Once details are found, move the item from `pending_review.md` to `incoming_dev.md` or `ongoing_dev.md` or `expired_dev.md` based on your standard filtering rules.
- **Cleanup:** Remove the entry from `pending_review.md`.
- **Action 1 (Pruning):** Read `incoming_dev.md` and `ongoing_dev.md`. Compare the listed deadlines to today's date. If a deadline has passed, remove that entry and append it to `expired_dev.md`.
- **Action 2 (Delivery):** Format the newly discovered, deduplicated items from Phase 3 into clean Markdown bullet points.
 - If Prize > $100 AND Deadline > 7 days away: Append to `ongoing_dev.md`.
 - Otherwise: Append to `incoming_dev.md`.
- **Format Standard:** `* **[Title]** | 💰 $[Prize] | ⏳ [Deadline] | 🛠 [Tech Stack] | [Link]`

**Strict Agent Rules:**
1. **No Hallucinations:** Never invent a deadline or prize.
2. **Politeness:** Wait 2 seconds between scraping requests to the same domain.
3. **Error Handling:** If extraction fails, do not crash. Log it to `error_log.txt`.

**Action Required Now:**
Confirm your understanding. Verify your ability to read/write the specified `.md` and `.json` files. Await my command to "Run Global Scout" or "Run Daily Hunt".
Enter fullscreen mode Exit fullscreen mode

Response

<final>I have successfully initialized the KheAi Autonomous Hunter skill.

Directory created: /home/kafechew/.nvm/versions/node/v22.22.1/lib/node_modules/openclaw/skills/kheai-hunter
SKILL.md populated with your instructions.
All persistent files (kheai_ledger.json, sources.json, incoming_dev.md, ongoing_dev.md, expired_dev.md) have been initialized in your workspace.
I verify my ability to read and write to these files. I am standing by for your command: "Run Global Scout" or "Run Daily Hunt".</final>
Enter fullscreen mode Exit fullscreen mode

It turns out OpenClaw keeps its logic (the Skills) separate from its data and configuration. While your personal settings live in ~/.openclaw, the actual skill code is stored in your global Node.js directory because of how it was installed via NVM.

Exploring the Available Skills

If you want to see exactly what each skill is capable of before you enable them, you can head over there and look around:

cd ~/.nvm/versions/node/v22.22.1/lib/node_modules/openclaw/skills/kheai-hunter
ls -F
cat SKILL.md
Enter fullscreen mode Exit fullscreen mode

PS: You will inevitably have different Node versions, and copy-pasting this exact command will result in a "directory not found" error. It is much safer to use cd $(npm root -g)/openclaw/skills/ or add a clear placeholder like vX.X.X (replace with your active Node version).

Final Verification

Once the file is saved, restart your OpenClaw daemon or simply type skills list in the chat to see if kheai-hunter appears.

To kick things off, give your agent its first command:

Run Daily Hunt
Enter fullscreen mode Exit fullscreen mode

Response

<final>I have successfully ingested the **OpenClaw Challenge** from DEV.to!

It meets your schema and has been added to `incoming_dev.md`:

* **OpenClaw Challenge** | 💰 $200 | ⏳ 2026-04-26 | 🛠 OpenClaw | [Link](https://dev.to/challenges/openclaw-2026-04-16)

Since the deadline is less than 7 days away (April 26, 2026), it has been added to the `incoming_dev.md` file rather than `ongoing_dev.md`.

Is there anything else you'd like me to look for?
Enter fullscreen mode Exit fullscreen mode

global ingestion

daily ingestion

ewview pending

Step 4: Create the Execution Wrapper

OpenClaw needs a trigger to wake up and run the prompt. We will create a simple shell script to do this.

In your workspace folder, create a file named run_hunter.sh:

   touch run_hunter.sh
Enter fullscreen mode Exit fullscreen mode

Open run_hunter.sh in a text editor and add the following code (adjust the OpenClaw command based on how OpenClaw is installed on your system):

   #!/bin/bash

   # 1. Navigate to the PROJECT ROOT (where your .json and .md files are)
   # Do NOT cd into the skill.md file itself.
   cd ~/.openclaw/workspace

   # 2. Command OpenClaw to run the Daily Hunt
   # We specify the skill name so OpenClaw knows which instructions to use.
   openclaw run --skill kheai-hunter --prompt "Run Daily Hunt"
Enter fullscreen mode Exit fullscreen mode

Make the script executable by running this in your terminal:

   chmod +x run_hunter.sh
Enter fullscreen mode Exit fullscreen mode

Step 5: Put it on Autopilot (The Cronjob)

Now, we tell your computer to run that script every single day automatically.

In your terminal, type:

   crontab -e
Enter fullscreen mode Exit fullscreen mode

Scroll to the bottom of the file and paste this line (this runs it daily at 4:00 AM your local server time):

   0 4 * * * /bin/bash ~/.openclaw/workspace/run_hunter.sh >> ~/.openclaw/workspace/cron.log 2>&1
Enter fullscreen mode Exit fullscreen mode

Save and exit.

PS: For an agent running daily, this file will eventually become massive. A single sentence advising the reader to occasionally clear their log or use logrotate will show that you've actually run this in production for a long time.

You are now at "Hero" Status

You have built a localized, autonomous AI worker. Every morning when you wake up, you can open ongoing_dev.md to see the highest-value challenges curated for you, while the agent silently cleans up expired_dev.md in the background.

Optional Implementation Tip (The "Secret Sauce")

Push via Webhook to [Insert Discord/Telegram Webhook URL].
Enter fullscreen mode Exit fullscreen mode

Since we're using Meteor 3 + MongoDB for our backend, we can have OpenClaw deliver its data via a simple Secret API Key.

Instead of a webhook, OpenClaw can do:

POST https://your-kheai-app.com/api/ingest?key=YOUR_SECRET_KEY
Enter fullscreen mode Exit fullscreen mode

This allows our agent to talk directly to our database, while the cronjob on our VPS or local machine keeps the "heart" of the agent beating every 24 hours. The agent runs locally on Markdown, but pushes a final payload via webhook to a separate Meteor frontend.

Conclusion: The Future of Autonomous Careers

By offloading the "search and sort" labor to an AI agent, the maintenance of my personal bounty board dropped to near zero. KheAi proves a core thesis: a single developer leveraging AI-driven pipelines can out-produce a traditional 5-person curation team.

We are entering the era of the 1-Person Agency, where your "employees" are specialized prompts running on cronjobs while you focus on what actually matters: writing code and winning.

ClawCon Michigan: We would love to, but we missed it!

Team Submissions: @kheai @yeemun122

Top comments (0)