I Stored Git Repos in DNA Before My Curiosity Ran Out(Kiro + Reed-Solomon)
I used Kiro's full stack (IDE, MCP servers, hooks, steering rules) to build a system that encodes git repositories into DNA sequences with Reed-Solomon error correction. What would have taken 2 weeks came together in a single hackathon sprint.
Also, I have confirmed that I can no longer think without AI. Here's how it went.
The Wild Idea
It started with a question at 2 AM: "What if you could store your code in DNA?"
Normal people at 2 AM think about their regrets. I thought about DNA. Not hypothetically. Actually. With real synthesis constraints, error correction, and the ability to recover from 5% base errors and 3% strand dropout.
Here's something you should know about me: my curiosity has a battery life of about 2 hours. After that it dies, and I go back to watching videos of people restoring rusty tools. So I had to build fast, before the curiosity ran out.
By 5:14 AM the same night, I had a working system. 100 out of 100 randomized trials passed with bit-perfect recovery. This is the story of how Kiro IDE didn't just speed up development, it fundamentally changed what was possible in a hackathon timeframe.
The Problem: DNA Storage Is Hard
DNA storage is theoretically amazing:
- 5.5 petabits per gram (Church et al., 2012)
- Lasts millennia (unlike hard drives that fail in 5 years, usually right before you back them up)
- Energy-free storage (just keep it cold and dry)
But it's practically nightmarish:
- 5% substitution error rate during sequencing (AāT, CāG randomly)
- 3% strand dropout (entire DNA molecules just vanish, like my socks in the laundry)
- Synthesis constraints: GC content must be 40-60%, no homopolymer runs longer than 3 bases, specific lengths only
You need error correction. Reed-Solomon codes can fix this... but only if you know where the errors are. Without that knowledge, you can only correct half as many errors.
The insight: Git repositories are content-addressed. Every commit, tree, and blob has a SHA-1 hash. When you decode corrupted data, git fsck tells you exactly which objects failed. Those map to specific Reed-Solomon shards. You just discovered your erasures for free.
This doubles your error correction capacity from (n-k)/2 to n-k. I like free things. Free things are my favorite things.
No prior DNA storage work (Church, Goldman, Erlich) used this trick. It was a novel idea... but could I actually build it?
Fighting with Architecture
Problem: DNA storage papers have beautiful diagrams but zero code. Thank you for the diagrams, truly, but I can't run a diagram.
I needed to design:
- Encoder: Git bundle ā Reed-Solomon shards ā DNA bases ā constraint screening
- Decoder: DNA ā consensus voting ā RS decode ā git verification
- Integration: How does git verification feed back into RS decoding?
Without Kiro: I'd sketch on paper, make wrong assumptions, code for 4 hours, realize the architecture is broken, then stare at the ceiling and refactor.
With Kiro: I described the problem in chat. Kiro suggested: "Use Kiro specs. Write requirements.md, design.md, and tasks.md before writing code. I'll validate the architecture."
Me, a hacker, being told to write documents first. I was offended for about 30 seconds. Then I did it.
I created .kiro/specs/ecc-layer/design.md:
## Block Organization Strategy
Cross-Strand Protection:
Data:D0D1D2... Dk-1
Strands: S0S1S2... Sn-1
Each RS block spans multiple strands. If a strand drops, it creates erasures across all blocks.
Kiro caught a flaw immediately: "If you do per-strand RS instead of cross-strand, a single dropout loses entire codewords. Cross-strand is 2Ć more efficient."
Time saved: ~6 hours of wrong implementation. Ego damage: minor.
The Codec Pipeline
Now I needed to actually build the thing. Encoder V2 (encoder-v2.ts)
What it does:
- Create git bundle (605 bytes for a small repo)
- Split into 19 Reed-Solomon data shards (32 bytes each)
- Generate 10 parity shards (53% overhead)
- For each shard: Convert bytes ā bits ā DNA bases (00āA, 01āC, 10āG, 11āT)
- Scramble with deterministic keystream (avoid patterns)
- Check constraints (GC 40-60%, max run ā¤3)
- If it fails, increment salt and retry
- Export FASTA format (standard DNA file)
Without Kiro: I'd write 500 lines of boilerplate, fight with Uint8Array conversions, and make off-by-one errors in bit shifting. Off-by-one errors and I are old friends. Not good friends, but old.
With Kiro: I described each step in comments. Kiro generated:
export async function encodeGitRepo ( repoPath : string , options : EncodeOptionsV2 ) : Promise < EncodeResultV2 > {
// 1. Create git bundle
const bundleInfo = createSimpleBundle ( repoPath ) ;
// 2. Calculate RS config
const rsConfig = calculateRSConfig ( bundleInfo . size , options . redundancy ) ;
// 3. Encode with RS
const { shards } = rsEncode ( bundleInfo . data , rsConfig ) ;
// 4. Convert to DNA with constraints
const oligos = shards . map ( ( shard , i ) => shardToOligo ( shard , i , options . constraints ) ) ;
return { oligos , bundleInfo , rsConfig , . . . } ;
}
But here's where Kiro became essential: I had a bug. Shard indices weren't mapping correctly to oligo indices after dropout. I spent 30 minutes confused, staring at the screen like it owed me money.
I asked Kiro: "Why is shard 5 missing but oligo 5 is present?"
Kiro responded: "You're mixing up chunk indices and shard indices. Add a chunkMap that tracks chunk ā shard ā oligo mapping."
Rude. Correct, but rude. It generated chunk-mapping.ts with the fix. Bug gone. Time saved: ~2 hours of head-scratching.
The Strategic Pivot
By 4 AM, I had encoding working. But decoding was fighting me. I'd implemented Reed-Solomon from scratch: Galois Field arithmetic, syndrome calculation, error locator polynomials.
Why from scratch? Because I'm either brave or stubborn, and at 4 AM those feel identical. Encoding worked. Decoding had subtle bugs in polynomial division. I was stuck. The clock was ticking and the Gate 1 deadline was in 1 hour.
I asked Kiro: "Should I keep debugging custom RS or switch to a library?"
Yes, I asked an AI whether to keep going or ask for help. I am aware of how that sounds. This is also how I know I can't make decisions without it anymore.
Kiro's response changed everything: "Consider wasm-reed-solomon-erasure . It's battle-tested, used in IPFS and Filecoin, and 10Ć faster than pure JS. Your custom implementation is a great learning exercise but high-risk for a deadline."
A library. A thing that already exists and works. Wild concept.
Decision: Pivot. I swapped in the library and wrapped it in rs-wrapper.ts. Tests went from 70% passing to 100% passing. Time saved: ~6 hours of debugging. Possibly saved the entire project.
The Magic of Hooks
Now I had a working encoder and decoder. But I was paranoid. Every tiny change could break something.
Problem: I needed to run tests constantly. But typing npm test 50 times is tedious. I'd forget, make a commit, realize tests fail, and waste time reverting. I forget to run tests the same way I forget to drink water.
Solution: Kiro Hooks. I created .kiro/hooks/test-on-codec-save.json:
{ "trigger" : "PostFileSave" , "matcher" : "src/codec/.*\\.ts$" , "action" : { "command" : "npm run test:roundtrip" } }
What this does: every time I save a file in src/codec/, Kiro automatically runs 100 randomized property tests.
Result:
- Caught 7 regressions before I even looked at the terminal
- Saved ~15 manual test runs (10 seconds each = 2.5 minutes saved per save = hours saved total)
- Gave me confidence to refactor aggressively
Then I added .kiro/hooks/pre-commit-verify.json:
{ "trigger" : "PreToolUse" , "matcher" : "execute_pwsh" , "action" : "npm run test:roundtrip (before git commit)" }
Result: zero broken commits. If tests fail, Kiro blocks the commit. No exceptions. It's like having a very strict friend who won't let you text your ex.
This is infrastructure-as-code, but for development workflows. Game changer.
MCP Server (The Cool Part)
By now I had a working codec. But I wanted something unprecedented: Kiro agents that could encode DNA autonomously.
The idea: build a custom MCP (Model Context Protocol) server that exposes DNA storage as tools Kiro can call.
I created .kiro/mcp-servers/dna-storage/server.ts:
import { Server } from '@modelcontextprotocol/sdk/server/index.js' ;
server . setRequestHandler ( ListToolsRequestSchema , async ( ) => {
return { tools : [ { name : 'dna-encode' , description : 'Encode data to DNA oligos' , inputSchema : { type : 'object' , properties : { data : { type : 'string' } , redundancy : { type : 'number' , default : 1.5 } } } } ,
// ... 4 more tools ] } ;
} ) ;
What this enables: I can now type in Kiro chat: "Encode this message to DNA: FRANKENSTEIN LIVES"
Kiro calls dna-encode via MCP. Returns:
sequence_1 ATCGATCGATGCTAGCTAGCTAGCTAG... GC content: 52.3% ā Max homopolymer: 3 ā
Or even better: "Archive my git repo to DNA storage"
Kiro calls dna-archive-repo, which:
- Creates a git bundle
- Encodes to DNA with Reed-Solomon
- Saves a FASTA file
- Runs git bundle verify and git fsck
- Returns: "ā Archived 605 bytes ā 29 DNA oligos"
This is autonomous DNA storage. No CLI. No scripts. Just natural language. I have never felt so powerful while doing so little typing.
How long did this take? 3 hours. Without the spec I wrote earlier, it would've been 8 hours minimum.
Steering Rules (The Secret Weapon)
Here's a subtle but powerful Kiro feature: steering rules. I created .kiro/steering/simulation-claims.md:
---
inclusion: always ---
NEVER claim wet-lab results. ALWAYS label everything as simulated.
Required phrases:
ā
"simulated DNA storage"
ā
"modeled synthesis constraints"
ā
"simulated sequencing noise"
Forbidden phrases:
ā "DNA synthesis"
ā "actual oligos"
ā "laboratory validation"
What this does: every time Kiro generates code, documentation, or UI text, it checks this file. If I write "DNA synthesis results", Kiro suggests: "Change to 'simulated DNA synthesis results' per simulation-claims.md."
Think of it as a swear jar, but for overclaiming.
Impact: it caught 8 instances where I'd written ambiguous language. They were automatically fixed before submission. Zero misleading claims in the final project.
Why this matters: hackathon judges need to understand scope. If I claimed real wet-lab work without doing it, credibility = destroyed. Steering rules enforce honesty automatically.
I also added .kiro/steering/domain-glossary.md with 25+ DNA storage terms:
- Oligo (Oligonucleotide) A short DNA strand, typically 100-200 nucleotides.
- GC Content Percentage of G and C bases. Must be 40-60% for synthesis stability.
- Erasure A known missing symbol. RS codes correct twice as many erasures as errors.
Result: every AI suggestion used correct terminology. No "DNA strings", always "oligos". No "broken code", always "erasures". Domain expertise baked into the AI, which is more than I can say for me before I read those papers.
The Gate 1 Victory
5:14 AM. I ran the final test: npx vitest run tests/property/gate1-full.test.ts
Output:
Trials: 100 Passed: 100/100 (100.0%) Failed: 0 Avg dropout:3.00% Avg eff. error: 0.0001% Total time: 18336ms (183ms/trial) š GATE 1 PASSED: 100/100 LOSSLESS!
Every. Single. Trial. Passed. 2KB git bundles. 5% substitution errors. 3% strand dropout. 10x read coverage. Bit-perfect recovery.
I stood up and cheered. At 5 AM. Alone. In the dark. My curiosity had officially expired hours ago, but apparently pure spite kept me going.
But here's the thing: this wasn't just passing tests. This was proof that:
- The architecture (specs-driven) was sound
- The implementation (AI-assisted) was correct
- The testing (hook-automated) was comprehensive
- The error correction (hash-guided erasure detection) actually worked
What Kiro Actually Did (The Honest Take)
Let me be clear: Kiro didn't write this project for me. (I say this while fully aware that I can't order a coffee without asking an AI for the best option.)
Here's the breakdown:
What I Did (The Hard Parts)
- Algorithm design: hash-guided erasure detection (the novel contribution)
- Architecture decisions: cross-strand RS, consensus voting, git bundle integration
- Domain knowledge: read the DNA storage papers (Church, Goldman, Erlich), understood constraints
- Math: calculated binomial probabilities for consensus voting, RS parameters for reliability
- Strategic pivots: decided when to use libraries vs. custom code (after being told, but still, I decided)
What Kiro Did (The Force Multiplier)
- Scaffolding: generated 2,000+ lines of boilerplate (encoders, decoders, test harnesses)
- Debugging: found off-by-one errors, type mismatches, edge cases
- Automation: hooks caught 19 regressions automatically
- Workflow: MCP server turned DNA encoding into natural language commands
- Quality assurance: steering rules enforced terminology and honesty
Key insight: Kiro is a 10Ć developer tool, not a 10Ć developer replacement. It doesn't replace expertise. It amplifies it.
The Numbers (Quantified Impact)
The "Without Kiro" column is my best guess, based on years of personal suffering.
Metric Without Kiro (est.) With Kiro (actual) Improvement Regressions caught ~5 (post-merge) 19 (pre-commit) 4Ć better Test runs (manual) 50 0 (automated) āĆ less tedious Architecture iterations 3-4 1 3Ć fewer rewrites MCP server dev time 8 hours 3 hours 62% faster Terminology errors ~10 0 (steering rules) Perfect
Bottom line: what would've been a 2-week project compressed into a 1-day hackathon sprint.
The Lessons (For Other Builders)
- Use Specs Before Code
I resisted this at first. "Specs are for enterprise Java devs, not hackers!" Wrong. Writing design.md before encoder.ts saved 6 hours of refactoring. Kiro validated the architecture before I wasted time implementing it wrong.
Takeaway: 30 minutes of spec-writing saves 6 hours of code rewriting. I hate that this is true.
- Hooks Are Infrastructure-as-Code for Dev Workflows
Automate everything that's repetitive: Tests on save? Hook. Tests before commit? Hook. Formatting on save? Hook.
Result: I never typed npm test manually. Kiro ran 150+ t
Comments
No comments yet. Start the discussion.