ai-framework-generator
v1.1.2
Published
Generate AI Agent Handoff Framework for any project - React, Python, Node.js, Go, or generic
Maintainers
Readme
🚀 AI Agent Handoff Framework Generator
Automatically generate AI-ready project documentation for seamless cross-chat continuity. Works with React, Python, Node.js, Go, or any project.
What It Does
This script generates 14 customized files for any new project in under 2 minutes:
AI Framework Files (Generic)
AI_MASTER.md- Master onboarding protocolAI_SYSTEM_PROMPT.md- Execution principlesAI_CONTEXT.md- Architecture for agentsAI_RULES.md- Operating constraintsDECISIONS.md- Settled decisions trackerPROGRESS.md- Task state trackingSCRATCHPAD.md- Mid-task resume stateAUDIT_LOG.md- Activity logAGENT_SESSION_TEMPLATE.md- Log entry format
Project Setup Files (Customized per project type)
.env.example- Tailored for React/Python/Node/Go.gitignore- Tailored for project type.cursorrules- AI development rulesREADME.md- Setup guide
Why This Matters
Problem: When working with AI agents across multiple chats, context is lost every time you start a new conversation.
Solution: This generator creates a repo-level documentation system that:
- ✅ Survives across chats (stored in git repo, not chat history)
- ✅ Works with any AI model (Claude, ChatGPT, Cursor, etc.)
- ✅ Automatically tailored to your project type
- ✅ Enforces continuity (audits, progress tracking, handoffs)
- ✅ Zero manual editing needed
Installation
Option 1: Run Directly
node generate-ai-framework.jsOption 2: Install Globally (optional)
npm install -g /path/to/ai-framework-generator
# Then run anywhere
ai-framework-genOption 3: Use as NPM Dependency
npm install ai-framework-generator --save-dev
# Add to package.json scripts
"scripts": {
"generate-framework": "node node_modules/ai-framework-generator/generate-ai-framework.js"
}
# Run
npm run generate-frameworkQuick Start
Step 1: Navigate to Your Project
cd /path/to/your/new/projectStep 2: Run the Generator
node generate-ai-framework.jsStep 3: Answer the Questions
The script will ask:
Project name (e.g., MyAwesomeApp):
One-line description:
Tech stack (e.g., React 19 + TypeScript):
Main entry point (e.g., src/App.tsx):
What kind of project is this?
1) React/Frontend
2) Python (FastAPI/Django/Flask)
3) Node.js/Backend
4) Go
5) Other
Pick (1-5):
[Additional questions based on project type...]Step 4: All Files Generated!
✨ Framework generated successfully!
📁 Generated files:
✓ AI Framework (9 files)
✓ Project Setup (.env.example, .gitignore, .cursorrules, README.md)
🎯 Next steps:
1. Review the generated files
2. Edit AI_CONTEXT.md to add architecture details
3. Update PROGRESS.md with your first task
4. Commit all files to git
5. Start using the framework!How It Customizes
The script asks about your project to customize all files:
What You Tell It
- Project type: React, Python, Node.js, Go, etc.
- Framework: Django, FastAPI, Flask, Express, etc.
- Features: Database? Authentication? External APIs? Tailwind CSS?
What It Customizes
.env.example: Pre-filled variables for your project type.gitignore: Patterns specific to React/Python/Node/Go.cursorrules: Development rules matching your tech stackREADME.md: Setup instructions for your project typeAI_CONTEXT.md: Architecture template for your tech stack
Example: React + Firebase Project
Project name: MyAuthApp
Project type: React
Do you use authentication? jwt/oauth: oauth
Do you call external APIs? firebase: YesGenerates:
.env.examplewithVITE_FIREBASE_API_KEY,VITE_AUTH_CLIENT_ID, etc..cursorruleswith React hooks, TypeScript, Firebase patterns.gitignorewith React-specific patternsREADME.mdwith React/Vite/Firebase setup instructions
Example: Python FastAPI + PostgreSQL
Project name: UserAPI
Project type: Python
Python framework: FastAPI
Database: postgresqlGenerates:
.env.examplewithDATABASE_URL,JWT_SECRET, etc..cursorruleswith FastAPI, async/await, type hints rules.gitignorewith Python/venv patternsREADME.mdwith FastAPI/PostgreSQL setup
File Descriptions
AI Framework Files
| File | Purpose |
|---|---|
| AI_MASTER.md | Start here - tells agents how to work |
| AI_SYSTEM_PROMPT.md | Quality standards and principles |
| AI_CONTEXT.md | Your project architecture (agent-readable) |
| AI_RULES.md | Don't-do list and constraints |
| DECISIONS.md | Locked-in architecture decisions |
| PROGRESS.md | Current task status |
| SCRATCHPAD.md | Resume state if mid-task |
| AUDIT_LOG.md | Append-only activity log |
| AGENT_SESSION_TEMPLATE.md | Format for audit entries |
Project Files
| File | Purpose |
|---|---|
| .env.example | Environment variables template |
| .gitignore | Git ignore rules |
| .cursorrules | Development practices |
| README.md | Project setup guide |
Usage Examples
New React Project
cd ~/projects/my-react-app
node ../ai-framework-generator/generate-ai-framework.js
# Answer prompts...
git add .
git commit -m "chore: add AI framework"New Python FastAPI Project
cd ~/projects/my-api
node ~/Documents/Projects/ai-framework-generator/generate-ai-framework.js
# Answer prompts...
git add .
git commit -m "chore: add AI framework"Existing Project
# Go to project root
cd ~/projects/existing-app
# Run generator in a new branch
git checkout -b feat/add-ai-framework
node ../ai-framework-generator/generate-ai-framework.js
# Review generated files
git add .
git commit -m "chore: add AI framework"
git pushAfter Generation
1. Review & Customize
Open AI_CONTEXT.md and fill in details about your architecture:
## Folder structure
- src/components/ - React components
- src/services/ - API calls
- src/utils/ - Helpers2. Set First Task
Edit PROGRESS.md:
## In progress
- Phase 1: Setup project structure
- Phase 2: Create authentication3. Commit to Git
git add .
git commit -m "chore: initialize AI handoff framework"
git push4. Use in AI Chats
When starting a new chat:
Continue MyAwesomeApp project.
Task: Implement user login.
Follow AI_MASTER.md protocol.The AI will automatically:
- Read AI_MASTER.md → learns the protocol
- Read PROGRESS.md → sees current status
- Read AI_CONTEXT.md → understands architecture
- Execute with full context
- Update PROGRESS.md + AUDIT_LOG.md
Project Types Supported
React/Frontend
- Customizes for React, TypeScript, Vite
- Includes Tailwind CSS option
- React Testing Library patterns
Python
- FastAPI: async/await, Pydantic, OpenAPI
- Django: ORM, migrations, Django patterns
- Flask: blueprints, requests patterns
Node.js
- Express with TypeScript
- Database support (PostgreSQL, MongoDB)
- Jest/Vitest testing
Go
- Project structure (cmd/, internal/, pkg/)
- Connection pooling, concurrency patterns
- go test -race standards
Other/Generic
- Creates basic templates
- Can be customized manually
File Structure After Generation
your-project/
├── AI_MASTER.md
├── AI_CONTEXT.md
├── AI_RULES.md
├── AI_SYSTEM_PROMPT.md
├── DECISIONS.md
├── PROGRESS.md
├── SCRATCHPAD.md
├── AUDIT_LOG.md
├── AGENT_SESSION_TEMPLATE.md
├── .env.example
├── .gitignore
├── .cursorrules
├── README.md
├── [your other files...]Advanced: Customization
After generation, you can customize:
- AI_CONTEXT.md: Add specific architecture details
- AI_RULES.md: Add project-specific constraints
- .cursorrules: Add team-specific practices
- .env.example: Add more variables
- PROGRESS.md: Define your actual phases
Troubleshooting
"Command not found: node"
Install Node.js from https://nodejs.org/
Files already exist
The generator will overwrite existing files. Back them up first if needed.
Need to regenerate
Just run the script again and answer the prompts. It will create new files.
Support
- See generated
README.mdfor project-specific help - See generated
AI_MASTER.mdfor AI collaboration guidelines - Check
.cursorrulesfor development standards
License
MIT
Built to solve the AI continuity problem across chats and agents.
