PAI Framework: How I Rebuilt a Personal AI Infrastructure for Trading and Cloud Work
A few months ago I discovered PAI — Personal AI Infrastructure — an open-source framework built by Daniel that turns Claude Code into a persistent, skill-based AI system. I forked it and have been rebuilding it around my own mission ever since.
My fork: github.com/davdunc/pai-framework
What Drew Me to PAI
I was already using Claude Code daily, but every conversation started from scratch. No memory of what I was working on, what I had tried before, or what I had learned. PAI solved that with an architecture I immediately respected:
- The Algorithm — A structured 7-phase execution framework (Observe, Think, Plan, Build, Execute, Verify, Learn) that produces verifiable outcomes. Every task generates Ideal State Criteria and tracks progress. This alone changed how I approach complex work.
- Skills — Modular capability packages with workflows and routing logic.
- Hooks — Lifecycle event handlers that fire on tool use, session events, and context management.
- Memory — A persistent file-based system that carries context across conversations.
- TELOS — A life operating system for goals, projects, and challenges that personalizes every interaction.
Daniel open-sourced all of this. I am grateful for the work and the generosity of sharing it.
How I Made It Mine
The original PAI had skills for OSINT investigations, security pentesting, visual content creation, and podcast editing. None of that is my work. I stripped it down and rebuilt around three pillars:
Systematic Trading (Primary Mission)
I am working toward consistent profitability as a momentum day trader, with a goal of transitioning to fully systematic, algorithmic execution. PAI now powers my morning game plans, market research, trade review, and discipline tracking. I am building a platform called Falcon that bridges DAS Trader with Python automation — and PAI is becoming the intelligence layer.
Fedora Cloud SIG (Community Work)
I contribute to Fedora Cloud images and bootable containers. PAI helps me manage community coordination, technical documentation, and release preparation.
The Bridge Between Them
Falcon validates cloud-native infrastructure patterns (Podman, Quadlets, bootable containers) while simultaneously generating trading income. The infrastructure work proves the OS patterns. The trading funds the time for community work.
What the Fork Looks Like
I audited every component against my actual needs:
- Kept: Trading, Research, Thinking (FirstPrinciples, Council debates), TELOS, Agents, Economic Metrics, and core utilities
- Archived: 10 skills and sub-skills that served someone else s mission
- Added: PreCompact hooks for context preservation, Elicitation hooks for MCP automation, mandatory prerequisite checks in the Algorithm
- Building next: FedoraCloud skill, Falcon platform skill, DAS Trader CMD API integration
The result is a leaner system that routes more accurately to what I actually do.
What I Have Learned
The most valuable thing about PAI is not the code — it is the philosophy. The idea that your AI assistant should know who you are, what you are working toward, and what you have learned from past mistakes. My PAI knows my trading rules, my risk tolerance, my behavioral patterns I am trying to fix, and my long-term goals. That context makes every interaction more useful than starting from zero.
I am also learning that the best tools for a systematic trader are not the same as the best tools for a discretionary one. My PAI is evolving toward quantitative approaches — backtested setups, algorithmic execution, math-grounded decisions. That is the trader I want to become, and having an AI partner that remembers that aspiration helps me stay on track.
Try It Yourself
If you use Claude Code and want persistent context:
- Check out Daniel s original work or my fork
- Copy the framework to
~/.claude/
- Create your own
PAI/USER/ directory with your goals and projects
- Start a conversation — the mode system kicks in automatically
The framework is a starting point. The value comes from making it yours.
David Duncan is a momentum trader, Fedora Cloud SIG contributor, and builder of AI-assisted infrastructure at davidduncan.org.