Skip to content

๐Ÿง  Universal AI Agent Knowledge Base & Rules System - Make your AI coding assistant smarter. Works with Cursor, Kiro, Windsurf, GitHub Copilot & Antigravity. Supports Linux, macOS & Windows.

License

Notifications You must be signed in to change notification settings

andiupn/andy-universal-agent-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

**English** | Bahasa Indonesia

andy-universal-agent-rules

๐Ÿง  Universal AI Agent Knowledge Base & Rules System

Make your AI coding assistant smarter. Works with any project, any editor.

License: MIT GitHub release GitHub issues GitHub pull requests Platform Python

GitHub stars GitHub forks Ko-Fi


๐ŸŽฌ Quick Start

New to andy-universal-agent-rules? Get up and running in 60 seconds:

Video Tutorial (Coming Soon)

3-Step Install

  1. Create a project folder

    mkdir my-project && cd my-project
  2. Run the installer

    • Windows: iwr -useb https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.ps1 | iex
    • Linux/Mac: curl -sL https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.sh | bash
  3. Start using workflows

    • Tell your AI: "Run the maintenance workflow"
    • Or: "Save learnings from this chat"

That's it! Your AI now has memory. ๐Ÿง โœจ


๐Ÿ“‚ Before You Install

Important: The installer will create .agent/ folder and AGENTS.md file in your current directory.

โœ… Recommended Setup

Create a dedicated folder first:

# Example 1: New project
mkdir my-awesome-project
cd my-awesome-project
# Now run installer here โ†“

# Example 2: Existing project
cd /path/to/your/existing/project
# Now run installer here โ†“

# Example 3: Windows (Laragon www/)
mkdir c:\laragon\www\my-project
cd c:\laragon\www\my-project
# Now run installer here โ†“

โŒ Common Mistake

# โŒ WRONG - Installing directly in www/ root
cd c:\laragon\www\
iwr -useb ... | iex  # This creates .agent/ in www/ directly!

# โœ… CORRECT - Create project folder first
cd c:\laragon\www\
mkdir my-project
cd my-project
iwr -useb ... | iex  # Now .agent/ is in my-project/

๐Ÿ“ What Gets Installed

After installation, your folder will look like this:

your-project/               # โ† Your current directory
โ”œโ”€โ”€ AGENTS.md               # โ† AI reads this first
โ””โ”€โ”€ .agent/
    โ”œโ”€โ”€ scripts/            # โ† Python automation scripts (6 files)
    โ”œโ”€โ”€ workflows/          # โ† AI workflows (6 files) ๐Ÿ†• CORE FEATURE
    โ”œโ”€โ”€ memory/             # โ† Your knowledge base
    โ”‚   โ”œโ”€โ”€ index.json
    โ”‚   โ””โ”€โ”€ entries/
    โ”‚       โ”œโ”€โ”€ gotchas/
    โ”‚       โ”œโ”€โ”€ patterns/
    โ”‚       โ”œโ”€โ”€ decisions/
    โ”‚       โ””โ”€โ”€ context/
    โ””โ”€โ”€ context/            # โ† Environment detection
        โ””โ”€โ”€ environment.json

โšก Quick Install

Linux/Mac (One-liner)

curl -sL https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.sh | bash

Windows PowerShell (One-liner)

iwr -useb https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.ps1 | iex

Manual

git clone https://github.com/andiupn/andy-universal-agent-rules.git
cp -r andy-universal-agent-rules/.agent ./
cp andy-universal-agent-rules/AGENTS.md ./
rm -rf andy-universal-agent-rules  # cleanup

๐ŸŽฏ What is This?

A knowledge management system for AI coding assistants. Instead of explaining the same bugs and solutions every chat session, your AI remembers:

  • โŒ Gotchas - Production bugs & how to avoid them
  • โœ… Patterns - Code patterns that work
  • ๐Ÿ“ Decisions - Architectural choices & why
  • ๐Ÿ“š Context - Project-specific guides

Result: Your AI assistant gets smarter over time.


๐Ÿ’ก Real-World Example

See how knowledge base saves hours of debugging time.

Scenario: The MySQL Connection Bug ๐Ÿ›

Day 1 - New Developer Joins:

Developer: "Help, MySQL connection refused!"
AI: "I don't know your setup. Try checking the port..."
Developer: *Googles for 30 minutes*
Solution: Use 127.0.0.1 instead of localhost on Windows

Developer saves the learning:

python .agent/scripts/save-knowledge.py --category gotchas \
  "MySQL Windows: Use 127.0.0.1 instead of localhost"

Day 30 - Another Developer Gets Same Error:

Developer: "Help, MySQL connection refused!"
AI: "I found a gotcha in your knowledge base! 
     Use 127.0.0.1 instead of localhost on Windows."
Developer: *Fixed in 5 seconds* โœ…

Time saved: 30 minutes โ†’ 5 seconds ๐Ÿš€

More Examples:

Problem Without Knowledge Base With Knowledge Base
Oracle commit bug Debug 2 hours Fixed in 1 minute
PHP version conflict Google 15 minutes AI knows immediately
API rate limit Trial & error Pattern already saved

Your AI learns from YOUR mistakes so you never repeat them!


๐Ÿ”ง Supported Editors

Editor Status
VSCode + GitHub Copilot โœ…
Cursor AI โœ…
Kiro AI โœ…
Windsurf Editor โœ…
Antigravity (Gemini/Claude) โœ…

๐Ÿ”ง Supported OS

OS Installer
Linux install.sh
macOS install.sh
Windows install.ps1

๐Ÿ“ What's Installed

your-project/
โ”œโ”€โ”€ AGENTS.md               # AI reads this first
โ””โ”€โ”€ .agent/
    โ”œโ”€โ”€ scripts/            # Automation scripts
    โ”‚   โ”œโ”€โ”€ save-knowledge.py
    โ”‚   โ”œโ”€โ”€ search-knowledge.py
    โ”‚   โ”œโ”€โ”€ validate-index.py
    โ”‚   โ””โ”€โ”€ backup-memory.py
    โ”œโ”€โ”€ workflows/          # ๐Ÿ†• AI workflows (CORE FEATURE)
    โ”‚   โ”œโ”€โ”€ maintenance.md
    โ”‚   โ”œโ”€โ”€ maintenance-agent-rules.md
    โ”‚   โ”œโ”€โ”€ save-from-chat.md
    โ”‚   โ”œโ”€โ”€ search.md
    โ”‚   โ”œโ”€โ”€ simpan-pengetahuan-dari-chat.md
    โ”‚   โ””โ”€โ”€ simpan-pengetahuan-dari-folder.md
    โ”œโ”€โ”€ memory/             # Your knowledge base
    โ”‚   โ”œโ”€โ”€ index.json
    โ”‚   โ””โ”€โ”€ entries/
    โ”‚       โ”œโ”€โ”€ gotchas/
    โ”‚       โ”œโ”€โ”€ patterns/
    โ”‚       โ”œโ”€โ”€ decisions/
    โ”‚       โ””โ”€โ”€ context/
    โ”œโ”€โ”€ context/            # Environment detection
    โ”‚   โ””โ”€โ”€ environment.json

๐Ÿ’ก How to Use

๐ŸŽฎ Interactive CLI (Recommended)

The easiest way to manage your knowledge base - no Python required!

Windows:

powershell -File .agent/scripts/agent-cli.ps1

Linux/Mac:

bash .agent/scripts/agent-cli.sh

This opens an interactive menu:

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘       andy-universal-agent-rules CLI               โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ 1. ๐Ÿ” Search Knowledge                             โ•‘
โ•‘ 2. ๐Ÿ’พ Save New Knowledge                           โ•‘
โ•‘ 3. ๐Ÿ”ง Run Maintenance                              โ•‘
โ•‘ 4. ๐Ÿ’ผ Backup Memory                                โ•‘
โ•‘ 5. ๐Ÿ“Š Show Stats                                   โ•‘
โ•‘ 6. โœ… Validate Index                               โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ’ก Tip: The CLI auto-detects Python. If found, uses full features. If not, uses native scripts with basic functionality.


๐Ÿ“œ Python Scripts (Advanced)

For automation or scripting, use Python directly:

# Save knowledge
python .agent/scripts/save-knowledge.py --category gotchas "Your gotcha here"

# Search knowledge
python .agent/scripts/search-knowledge.py "mysql connection"

# Validate index
python .agent/scripts/validate-index.py --fix

# Backup
python .agent/scripts/backup-memory.py

๐Ÿ”„ Using Workflows

After installation, you get 6 AI-powered workflows that make knowledge management effortless. Just talk to your AI!

/maintenance - Keep Knowledge Base Healthy

Validates index, creates backups, updates environment automatically.

Usage:

"Run the maintenance workflow"
"Do maintenance on the knowledge base"

What it does:

  • โœ… Validates index.json integrity
  • โœ… Creates backup of .agent/memory/
  • โœ… Updates environment detection
  • โœ… Syncs statistics to AGENTS.md

/save-from-chat - Save Current Session Learnings

Scans your chat for gotchas, patterns, and decisions to save automatically.

Usage:

"Save learnings from this chat"
"Save knowledge from our conversation"

What it does:

  • ๐Ÿ” Analyzes chat history
  • ๐Ÿ“ Extracts gotchas, patterns, decisions
  • ๐Ÿ’พ Saves to .agent/memory/entries/
  • ๐Ÿ”„ Updates index automatically

/search - Find Existing Knowledge

Quick search before starting work to avoid reinventing solutions.

Usage:

"Search for MySQL gotchas"
"Find knowledge about authentication"

What it does:

  • ๐Ÿ”Ž Searches across all categories
  • ๐Ÿ“Š Ranks by relevance
  • ๐Ÿ“„ Shows matching entries with context

Indonesian Workflows ๐Ÿ‡ฎ๐Ÿ‡ฉ

For Indonesian speakers:

  • /simpan-pengetahuan-dari-chat - Save dari percakapan
  • /simpan-pengetahuan-dari-folder - Save dari folder

Pro Tip: Workflows work best with:

  • โœ… Antigravity (Gemini/Claude)
  • โœ… Cursor (Agent Mode)
  • โœ… Kiro AI

For other editors, use Python scripts directly:

python .agent/scripts/save-knowledge.py --category gotchas "Your gotcha"

๐Ÿง  The Magic: Priority Loading

When an AI opens your project, it automatically loads:

  1. ๐Ÿšจ Critical Gotchas (avoid bugs)
  2. ๐Ÿ“Š Environment Info (OS, stack, versions)
  3. ๐Ÿ” Top Patterns (most-used solutions)
  4. ๐Ÿ“ Project Context (what this project is about)

Your AI knows your project before you even ask.


โ“ FAQ

How is this different from just using .cursorrules?

.cursorrules is a single static file that AI reads once.

andy-universal-agent-rules is a dynamic knowledge management system:

  • โœ… Searchable knowledge base - Find solutions from past bugs
  • โœ… Scripts for automation - Save, search, validate, backup
  • โœ… Workflows - Pre-built commands like /maintenance, /save-from-chat
  • โœ… Cross-editor support - Works with Cursor, VSCode, Kiro, Windsurf, Antigravity
  • โœ… Grows over time - Your AI gets smarter as you add knowledge

Think of it as .cursorrules + Git for your AI's memory.

Can I use this with multiple projects?

Yes! Install in each project separately:

# Project 1
cd ~/projects/my-app
iwr -useb https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.ps1 | iex

# Project 2
cd ~/projects/another-app
iwr -useb https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.ps1 | iex

Each project has its own independent knowledge base in .agent/memory/.

How do I uninstall?

Simply delete the folders:

# Remove agent rules
rm -rf .agent
rm AGENTS.md

# Or on Windows PowerShell
Remove-Item -Recurse -Force .agent
Remove-Item AGENTS.md

Optional: Remove from git history if committed:

git rm -r .agent AGENTS.md
git commit -m "Remove andy-universal-agent-rules"

Does this work offline?

Yes! After installation, everything works offline:

  • โœ… Scripts run locally (Python stdlib only)
  • โœ… Knowledge base stored locally
  • โœ… No API calls or internet required

Only internet needed:

  • During installation (to download files)
  • If using AI features (your AI needs internet, not this tool)

Will this slow down my editor?

No! This system is:

  • โœ… Passive - Only read by AI when needed
  • โœ… Lightweight - Python scripts ~50KB total
  • โœ… Fast - All scripts run <500ms (see benchmarks)

Your editor performance is unaffected.


๐Ÿ”ง Troubleshooting

Python not found

Error: python: command not found or 'python' is not recognized

Solution:

Windows:

# Download Python from python.org
# Or install via winget
winget install Python.Python.3.12

# Verify installation
python --version

Linux/Mac:

# Ubuntu/Debian
sudo apt install python3

# macOS
brew install python3

# Verify
python3 --version

Permission errors during installation

Error: Permission denied or Access is denied

Solution:

Windows:

# Run PowerShell as Administrator
# Right-click PowerShell โ†’ "Run as administrator"

Linux/Mac:

# Don't use sudo with installer!
# Instead, ensure you have write access to current directory
cd ~/projects/my-project  # Your user directory
curl -sL ... | bash

Git conflicts with .agent/ folder

Error: Merge conflicts in .agent/memory/

Solution:

Option 1: Keep your version (recommended)

git checkout --ours .agent/memory/
git add .agent/memory/
git commit

Option 2: Merge manually

# Resolve conflicts in .agent/memory/index.json
# Keep both knowledge bases if needed
git add .agent/memory/
git commit

Prevention: Add to .gitignore:

.agent/memory/entries/
.agent/context/environment.json

Workflows not working / not found

Error: AI says "workflow not found" or /maintenance doesn't work

Solution:

  1. Verify workflows installed:
ls .agent/workflows/
# Should show: maintenance.md, save-from-chat.md, etc.
  1. Reinstall if missing:
iwr -useb https://raw.githubusercontent.com/andiupn/andy-universal-agent-rules/main/install.ps1 | iex
  1. Check editor compatibility:
    • Workflows work with: Antigravity, Cursor (Agent Mode), Kiro
    • For VSCode/Copilot: Use scripts directly instead

Scripts show ModuleNotFoundError

Error: ModuleNotFoundError: No module named 'xyz'

This should NOT happen! All scripts use Python stdlib only.

If it occurs:

# Check Python version (need 3.10+)
python --version

# Verify it's using system Python, not a venv
which python  # Linux/Mac
where python  # Windows

Still broken? Report issue


๐Ÿ’– Support This Project

If this saves you hours of debugging, consider supporting:

Platform Link
Ko-fi ko-fi.com/andiupn
Patreon patreon.com/AndiUpn
Trakteer ๐Ÿ‡ฎ๐Ÿ‡ฉ trakteer.id/andi_upn
Saweria ๐Ÿ‡ฎ๐Ÿ‡ฉ saweria.co/andiupn

๐Ÿ“œ License

MIT License - Use it anywhere, modify freely.

Version tracking: See CHANGELOG.md for release history.


๐ŸŒŸ Star This Repo!

If you find this useful, please โญ star this repo to help others find it!


Made with โค๏ธ by Andi UPN

About

๐Ÿง  Universal AI Agent Knowledge Base & Rules System - Make your AI coding assistant smarter. Works with Cursor, Kiro, Windsurf, GitHub Copilot & Antigravity. Supports Linux, macOS & Windows.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •