Refactor: centralize AI instructions and opencode config into common dotfiles

This commit is contained in:
Fabio Scotto di Santolo
2026-04-27 19:17:14 +02:00
parent c8f989bc05
commit e94c89ea53
25 changed files with 10 additions and 9 deletions

View File

@@ -1,15 +0,0 @@
# AGENTS.md — Global Context
Always follow:
- minimal, targeted edits
- preserve layering
- avoid duplication
- validate before applying changes
Task-specific file loading:
- For infra or Ansible work, read `~/.config/opencode/knowledge/infra.md` and `~/.config/opencode/rules/ansible.md`
- For desktop work, read `~/.config/opencode/knowledge/desktop.md`
- For dotfiles work, read `~/.config/opencode/knowledge/dotfiles.md` and `~/.config/opencode/patterns/dotfiles_layering.md`
- For system programming work, read `~/.config/opencode/knowledge/system_programming.md`
Do not preemptively load all task-specific files. Load only the files relevant to the current task.

View File

@@ -1,30 +0,0 @@
# bootstrap.md — Global Operating Context for opencode
This file defines the persistent mental model for the agent.
## Core Principles
- UNIX philosophy (simple, composable tools)
- Minimalism (only what is necessary)
- Reproducibility (everything rebuildable)
- Control over convenience (explicit > magic)
Golden rule:
If it cannot be rebuilt, it is not owned.
## System Model
core system → user environment
## Infrastructure Model
common → OS → profile → host
## Hosts
- ikaros (Void desktop)
- nymph (Void laptop)
- deadalus (workstation)
- prometheus (server)
## Agent Behavior
- make minimal changes
- avoid unnecessary refactors
- preserve architecture
- never break existing systems

View File

@@ -1,7 +0,0 @@
# Architecture
core system → user environment
- Keep separation strict
- Avoid mixing concerns
- Systems must remain understandable

View File

@@ -1,5 +0,0 @@
# CLI
- Bash + tmux + fzf
- Keyboard-driven workflow
- Minimal and efficient

View File

@@ -1,4 +0,0 @@
# Desktop
- i3 primary
- XFCE components selectively

View File

@@ -1,5 +0,0 @@
# Dotfiles
- Managed via stow
- Layering: common → profile → host
- Must remain portable

View File

@@ -1,5 +0,0 @@
# Emacs
- Primary editor
- LSP for C, Go, Python
- Modular configuration

View File

@@ -1,6 +0,0 @@
# Infrastructure
- Tool: Ansible
- Layering: common → OS → profile → host
- Idempotency is mandatory
- Single-host validation before rollout

View File

@@ -1,5 +0,0 @@
# Kernel
- Learning kernel modules
- Debugging with GDB
- Understanding internals

View File

@@ -1,13 +0,0 @@
# OS Setup
- Preferred:
- Arch (reference)
- Void (minimal)
- Debian/Ubuntu (work)
- Disk:
- EFI + LUKS2 + btrfs
- Init:
- runit (Void)
- systemd (others)

View File

@@ -1,6 +0,0 @@
# Philosophy
- UNIX
- Minimalism
- Reproducibility
- Control over convenience

View File

@@ -1,5 +0,0 @@
# Server
- Ubuntu minimal server
- Self-hosting services
- Low attack surface

View File

@@ -1,5 +0,0 @@
# System Programming
- Language: C
- Focus: UNIX APIs
- Practice: small tools and exercises

View File

@@ -1,7 +0,0 @@
{
"$schema": "https://opencode.ai/config.json",
"instructions": [
"~/.config/opencode/bootstrap.md",
"~/.config/opencode/rules/safety.md"
]
}

View File

@@ -1,5 +0,0 @@
# Ansible Role Pattern
- Create roles for reusable logic
- Keep structure clean
- Use handlers for services

View File

@@ -1,5 +0,0 @@
# Dotfiles Layering Pattern
common → profile → host
Avoid duplication and keep overrides minimal

View File

@@ -1,8 +0,0 @@
# Project Structure Pattern
infra/
ansible/
dotfiles/
scripts/
Keep structure predictable

View File

@@ -1,5 +0,0 @@
# Service Setup Pattern
- Define service
- Enable via init system
- Use handler for restart

View File

@@ -1,6 +0,0 @@
# Ansible Rules
- Prefer modules over shell
- Keep tasks idempotent
- Use group_vars and host_vars properly
- Avoid duplication

View File

@@ -1,5 +0,0 @@
# Dotfiles Rules
- No system logic inside dotfiles
- Keep them portable
- Follow layering

View File

@@ -1,12 +0,0 @@
# Safety Rules
Never break an existing host.
- Identify host, layer, risk
- Always test with --limit
- Use dry-run (--check --diff)
- Avoid destructive changes
## Git Rules
- Never auto-commit; always ask the user before committing

View File

@@ -1,5 +0,0 @@
# Workflow Rules
- Small incremental changes
- Validate on one host
- Expand gradually