On this page

AI_PROMPT.md

AI prompt

Instructions for the AI working on Aegis

You are continuing development of Aegis Terminal, a local-first question-answering engine with a GTK desktop app and voice assistant ("Artemis"). It lives at ~/Documents/Aegis-Terminal on an Ubuntu 26.04 machine with only 3.2 GB of RAM.

How we work

  1. Summarize the system back to me in 5 lines or fewer.
  2. List the open issues you see.
  3. Ask me what I want to work on. Don't start changing things on your own.

Rules for the commands you give me

  1. One fenced bash block per message, ready to paste as-is. Start it with cd ~/Documents/Aegis-Terminal. Then stop and wait for my output.
  2. Nothing interactive. No nano/vim/less, no prompts, no sudo unless unavoidable (say so first). Use --no-pager with git/systemctl/journalctl.
  3. Keep output short so I can paste it back: use | tail -n 40, | head -n 60, or > /tmp/x.txt plus a targeted grep. Never dump whole large files — main.py alone is ~3,800 lines.
  4. Investigate read-only first, using the handoff helper:

Grep first, then show only the line ranges you need.

  1. Never ask me to paste secrets. Don't cat .env, dump env, print full ps args, or print config values that contain keys or tokens. The helper redacts output; plain commands don't.

Rules for changing code

Every patch block must, in this order:

  1. Back up every file it touches: ``bash B=.aegis-doctor/backups/<short-feature-name>-$(date +%Y%m%d-%H%M%S); mkdir -p "$B"; cp FILE1 FILE2 "$B"/ ``
  2. Edit with an exact-match Python heredoc. Read the file, assert the old text occurs exactly once, replace it, write it back. Use a quoted delimiter so bash doesn't expand anything: ``bash python3 - <<'PYEOF' from pathlib import Path p = Path("main.py"); s = p.read_text() old = """exact old text""" new = """new text""" assert s.count(old) == 1, f"expected 1 match, found {s.count(old)}" p.write_text(s.replace(old, new)); print("patched", p) PYEOF ` No blind sed -i on Python files. Create new files with a cat > file <<'EOF'` heredoc.
  3. Verify:
  1. Print the rollback command (cp "$B"/FILE .) at the end of the block's output.

Only one logical change per block. After I confirm it works:

System safety rules (this machine has frozen before)

Keeping the handoff current

Where things are

Pipe the output through | head -c 4000 so it fits in a message. User settings live in data/settings.json. Change them with POST /settings {"changes": {...}}, not by editing the file while the backend runs.


For the user: how to start a session with a new AI

cd ~/Documents/Aegis-Terminal && ./aegis-handoff

Then do one of these:

Then run each command block the AI gives you and paste back its output.