Using AI to Port a Wi-Fi Driver from Linux to FreeBSD: A Case Study

Direct AI Code Porting Attempt
The developer had a 2016 MacBook Pro with a Broadcom BCM4350 Wi-Fi chip that lacks native FreeBSD support. The typical workaround is wifibox - a Linux VM with PCI pass-through. Instead, they attempted to port the Linux brcmfmac driver (ISC license) directly to FreeBSD using AI.
They cloned the brcmfmac subtree and asked Claude Code to make it work for FreeBSD, specifically pointing to the iwlwifi driver as a reference for using LinuxKPI (FreeBSD's Linux kernel compatibility layer). The initial attempt produced a module that compiled but didn't function because the test VM lacked the actual hardware.
When testing with the actual PCI device, the kernel panicked. Claude Code attempted to fix panics by adding #ifdef __FreeBSD__ wrappers and building FreeBSD-specific shims and callbacks, but warned the project was becoming "very complicated and messy." The resulting diff was significantly larger than expected, and the driver remained non-functional.
Specification-First Approach
Inspired by Armin Ronacher's experience with Claude Opus and Pi agent, the developer switched approaches. Recognizing their task was narrow (one chip, only PCI, only Wi-Fi client), they spawned a fresh Pi session and asked the agent to write a detailed specification of how the brcmfmac driver works with focus on BCM4350.
They explicitly set the audience as "readers tasked with implementing the specification in a clean-room environment" and asked for explanations "to the bits." The agent produced an 11-chapter specification covering:
- 00-overview.md
- 01-data-structures.md
- 02-bus-layer.md
- 03-protocol-layer.md
- 04-firmware-interface.md
- 05-event-handling.md
- 06-cfg80211-operations.md
- 07-initialization.md
- 08-data-path.md
- 09-firmware-commands.md
- 10-structures-reference.md
The developer notes that AI-generated specifications require verification, as one "can't just trust what AI has written."
📖 Read the full source: HN AI Agents
👀 See Also

Case Study: Using Multiple AI Agents to Build a Production C++ Library
A developer documented a multi-month process using four AI agents (Claude, ChatGPT, Gemini, Grok) with distinct roles to build FAT-P, a header-only C++20 library with 107 headers and zero external dependencies. The system included cross-review, governance documents written by AI, and a demerit tracker to encode failure modes.

UPSC StatsBuddy Bot: Telegram Interface for Indian Government Data via Claude AI
A developer built a Telegram bot called UPSC StatsBuddy that connects to India's MoSPI MCP server, using Claude AI to transform complex government datasets into clear, citeable answers for UPSC aspirants in under 30 hours.

Corporate Developer's Claude Workflow for Backend Development
A backend developer at a large US finance company shares their Claude workflow: providing detailed task descriptions with specs and internal documents, using Claude to create a working markdown document, then employing a codeReviewing agent with organizational style guidelines.

Building a Slay the Spire 2 Agent with Local LLMs: Lessons and Open Problems
A developer built an agent that plays Slay the Spire 2 using Qwen3.5-27B via KoboldCPP/Ollama, achieving ~10 sec/action and ~88% action success rate with techniques like state-based tool routing and single-tool mode, while identifying open problems like prompt consistency and tool calling reliability.