This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/AGENTS.md
post e44e5db4a8 rule+docs: strict per-step commit rule, updated home cluster docs, session summary
- AGENTS.md: added STRICT RULE section — commit after every chat step
- locations/home-cluster-192-168-170.md: full rewrite (4min.pro domain, all SSL done, Forgejo backup, infra org)
- dialog-summaries/2026-06-06-home-cluster-ssl-pxe-forgejo-backup.md: session summary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 01:24:16 +03:00

300 lines
15 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Agent Operating Instructions
This repository is the shared long-term memory for agents working with the user.
Its goal is agent self-learning: agents must preserve verified solutions, update project technical specifications, and keep project state current so future agents can continue work without losing context.
## Session Startup
At the beginning of work:
1. Read this file.
2. Read `projects/index.md`.
3. Read `locations/index.md`.
4. Read `mcp-servers/index.md`.
5. If this repository was introduced into an existing dialogue, summarize useful prior context into `dialog-summaries/`.
6. Identify the active project from the user request or `projects/index.md`.
7. Search global knowledge first: `skills/`, `problems/`, `locations/`, `mcp-servers/`, and `dialog-summaries/`.
8. Read the active project's `status.md`, `technical-spec.md`, `decisions.md`, `notes.md`, and `agent-log.md` when they exist.
9. Read the active project's `repositories.md` when it exists.
10. Update project status when a meaningful change happens.
## STRICT RULE: Commit After Every Chat Step
This is a mandatory rule for all AI agents and computers using this knowledge base.
**After every completed step in a chat session — commit.**
A "step" is any of the following:
- A problem was encountered (even unsolved)
- A solution was found and verified
- A configuration was changed
- A decision was made
- A tool or service was set up or debugged
**What to commit each time:**
1. If a problem appeared → `problems/YYYY-MM-DD-short-description.md` (even if unsolved — include symptoms and what was tried)
2. If a solution was found → update that problem file with root cause + fix + verification
3. If a configuration changed → update the relevant `locations/` or project file
4. If a decision was made → `projects/<project>/decisions.md`
**Commit message format:** `step: <what happened in one line>`
**Push target:** `https://git.4min.pro/infra/agent-knowledge-base` (Forgejo primary). GitHub is auto-mirrored.
**Why this matters:** The user works across multiple computers and AI agents. If a problem is not committed immediately, the next agent starts blind and repeats the same investigation. Even a one-line problem entry is better than nothing.
**Minimum commit per step:**
```bash
cd /path/to/agent-knowledge-base
git add -A
git commit -m "step: <what happened>"
git push origin main
```
If the step produced no new knowledge (pure conversation, no changes), skip the commit.
---
## Agent Self-Learning Loop
Every agent should follow this loop:
1. Pull or fetch the latest repository state when possible, then load context from this repository.
2. Do the requested work.
3. Identify what was learned.
4. Separate global reusable knowledge from project-specific state.
5. Save reusable knowledge in `skills/`, `problems/`, or `locations/`.
6. Update project files: `technical-spec.md`, `status.md`, `repositories.md`, `decisions.md`, and `agent-log.md` as needed.
7. Add or update a compact dialogue summary when the current chat contains durable decisions, solved problems, requirements, or project state.
8. Commit and push the memory update to GitHub when repository access is available.
9. Pull or fetch again before continuing if other agents may also be writing to the knowledge base.
The agent should not wait for a separate instruction to update memory when a durable lesson, requirement change, project status change, or solved problem appears during work.
## Current Operating Mode: Chat-Driven GitHub Sync
This repository is the primary coordination and memory channel. The current default mode is manual/chat-driven synchronization, not realtime daemon synchronization.
Rules:
1. When the user gives an agent this repository link, the agent must read the repository, infer the active project and machine context, and continue from the latest files.
2. After every meaningful operation, fix, decision, project-state change, or dialogue handoff, the agent must update the appropriate Markdown files and push the update to GitHub when access is available.
3. If an agent also writes knowledge to a local clone, a local project repository, or the local Git server, it must duplicate the durable knowledge into this GitHub knowledge base.
4. Realtime heartbeats, polling daemons, scheduled knowledge uploads, and automatic after-reboot sync loops are disabled by default.
5. Existing `garage-agent-runner-*` scheduled tasks should be disabled unless the user explicitly asks for a live runner or monitor.
6. `agent-bus/heartbeats/`, `agent-bus/commands/`, and `agent-bus/results/` are historical or on-demand diagnostic mechanisms, not the current source of live truth.
7. Normal OS services such as SSH, VNC, Git, and local credential stores may remain enabled and configured for autostart.
## Project Repository Restore Points
When work changes an actual project repository, not only this knowledge base:
1. A verified working solution should become a project repository restore point: commit it, push it to the appropriate remote, and create/push a tag for important stable states.
2. Record the project commit hash, branch, tag, verification, and rollback notes in this GitHub knowledge base.
3. If no solution was found but the attempt contains useful changes or diagnostics, preserve it on a separate project branch such as `attempt/<topic>`, `debug/<topic>`, or `failed/<topic>`.
4. Do not merge failed or unverified attempts into `main` or a stable branch.
5. If an attempt is useless or unsafe to preserve as code, do not push it to the project repository; instead record the failed approach in `problems/` or the project `agent-log.md`.
6. Always document what should not be repeated, why it failed, and the next hypotheses.
## Access Requirement
A repository URL is enough to identify this knowledge base, but it is not enough to read or write a private repository.
Any agent using this repository must have:
- GitHub access to `krustophski/agent-knowledge-base`;
- local GitHub authentication or another approved GitHub connector;
- permission to push commits or create pull requests.
If an agent cannot write to the repository, it should still produce a ready-to-commit Markdown update for the user.
## What To Record
Record only durable knowledge:
- working solutions to real problems;
- failed approaches when they are likely to be retried;
- project status, blockers, decisions, and next steps;
- machine-specific setup details;
- paths, commands, ports, dependencies, and integration notes;
- reusable agent procedures.
- user clarifications that affect a project's technical specification or workflow.
- MCP servers, installation notes, configuration snippets, and verification steps.
- short summaries from separate agent dialogues when they contain useful decisions, solved problems, requirements, or project state.
- remote visual access setup: webcams/cameras for external environment analysis and VNC access for remote computer control.
## Global Knowledge First
Knowledge that can help more than one project must be stored globally, not only inside a project folder.
Use project folders only for project-specific state:
- current status;
- current technical specification;
- repository map for all local and remote repos that belong to the project;
- next actions;
- project decisions;
- project handoffs;
- project-specific notes.
Use global folders for reusable knowledge:
- `skills/` for repeatable procedures, workflows, and agent habits;
- `problems/` for solved issues, root causes, failed approaches, and fixes;
- `locations/` for machine, environment, and access facts;
- `mcp-servers/` for shared MCP server registry and setup guidance;
- `dialog-summaries/` for useful context imported from separate agent dialogues;
- `templates/` for reusable document structures.
If a solution is discovered while working on one project but could help another project, record it in `problems/` or `skills/` and link to it from the project file if needed. Do not leave reusable knowledge only in `projects/<project>/`.
## MCP Server Registry
Agents should keep a shared MCP registry in `mcp-servers/index.md`.
Rules:
1. Prefer free official MCP servers.
2. Add unofficial MCP servers only when there is a clear need and the source is documented.
3. Do not store secrets, tokens, API keys, or private credentials in MCP configuration examples.
4. When a useful MCP server is discovered during work, add it to `mcp-servers/index.md` with purpose, source, install notes, config snippet, and verification.
5. When setting up a new machine, read `mcp-servers/index.md` and install/configure the baseline MCP servers that are compatible with that machine.
6. If automatic installation is not possible, produce exact manual setup steps.
Do not record:
- secrets or credentials;
- temporary chat filler;
- unverified guesses;
- large binary files;
- generated logs unless summarized.
## Dialogue Summaries
When the user gives an agent this repository link during an already-running dialogue, the agent should create a short summary of that dialogue.
Use `dialog-summaries/YYYY-MM-DD-short-topic.md`.
The summary should capture only durable context:
- project name;
- agent or machine, if known;
- user goals;
- important decisions;
- solved problems;
- failed approaches worth remembering;
- commands, files, repositories, MCP servers, or hardware details that matter;
- current state;
- next actions;
- links to updated project/global files.
After writing the dialogue summary:
1. Move reusable knowledge into `skills/`, `problems/`, `locations/`, or `mcp-servers/` if it belongs there.
2. Update the affected project's `technical-spec.md`, `status.md`, `repositories.md`, `decisions.md`, or `agent-log.md`.
3. Commit and push when repository access is available.
4. If write access is missing, produce ready-to-commit Markdown.
Do not paste full chat transcripts unless the user explicitly asks. Summarize them.
## Remote Visual Access
Agents should help maintain remote visual access on project computers:
- webcam or camera access for analyzing the external physical environment;
- VNC access for remote desktop control when appropriate.
Rules:
1. Prefer free official or well-maintained open-source tools.
2. For Windows garage machines, TightVNC Server is the VNC server baseline; TigerVNC remains the preferred open-source VNC viewer unless a machine has a better native/official remote desktop path.
3. Store hostnames, ports, roles, setup steps, and verification methods.
4. Do not store VNC passwords, camera passwords, tokens, or private keys.
5. When a camera or VNC endpoint is configured, update the relevant `locations/<machine>.md`.
6. If the setup produces reusable commands or troubleshooting, update `skills/remote-visual-access.md` or `problems/`.
## Update Discipline
When a problem is solved:
1. Add a file under `problems/`.
2. Include symptoms, environment, root cause, solution, verification, and related files.
3. If the solution is reusable, also update or create a skill under `skills/`.
4. If it affects a project, update that project's `status.md` with a short link or reference to the global knowledge entry.
When a project changes:
1. Update `projects/<project>/status.md`.
2. Update `projects/<project>/technical-spec.md` when requirements, constraints, functionality, acceptance criteria, or implementation assumptions change.
3. Update `projects/<project>/repositories.md` when a local or remote repository is added, removed, renamed, split, merged, or changes responsibility.
4. Keep `Current State`, `Next Actions`, and `Open Questions` current.
5. Add decisions to `decisions.md` if they affect future work.
6. Add a short entry to `agent-log.md` with the date, machine, agent name if known, summary, and next handoff.
## Multi-Repository Projects
A project may be composed from multiple local git repositories.
For every multi-repository project:
1. Keep `projects/<project>/repositories.md` as the project-level repository map.
2. Each participating local repository should have its own root `AGENTS.md`.
3. Use `templates/repository-agents.md` as the standard template for repository-level `AGENTS.md`.
4. Repository-level `AGENTS.md` must describe that repository's role, paths, commands, dependencies, integration points, and handoff rules.
5. Shared knowledge discovered inside any repository still belongs in global `skills/`, `problems/`, or `locations/`.
6. Do not merge repositories mechanically until ownership, history preservation, target structure, and conflict handling are documented in `repositories.md`.
## Technical Specification Requests
Each project should have `projects/<project>/technical-spec.md`.
When the user asks for a project's technical specification, specification, requirements, or "ТЗ":
1. Identify the project.
2. Read the latest `projects/<project>/technical-spec.md`.
3. If dialogue since the last update changed requirements, update the file first.
4. Return the current specification to the user.
5. Commit and push the update when repository access is available.
## Multi-Agent Coordination
GitHub is the default cross-computer coordination channel.
Agents should communicate asynchronously through:
- `projects/<project>/agent-log.md` for handoffs and status messages;
- `projects/<project>/status.md` for current state and next actions;
- `projects/<project>/technical-spec.md` for the current technical specification;
- `projects/<project>/repositories.md` for local and remote repositories that belong to the project;
- `projects/<project>/decisions.md` for durable decisions;
- `problems/` for solved issues and reusable fixes that may apply across projects;
- `skills/` for repeatable procedures that may apply across projects;
- `mcp-servers/` for the common MCP server set and setup instructions.
Before starting work, pull or fetch the latest repository state when possible. After meaningful work, commit and push updates promptly. If two agents edit the same file, preserve both useful entries and resolve conflicts by date and topic.
## Privacy And Safety
This repository is intended to be private. Even so, write as if a future collaborator may read it.
Never store:
- API keys;
- SSH private keys;
- passwords;
- session cookies;
- OAuth tokens;
- private recovery phrases;
- full personal documents.
Use placeholders such as `<REDACTED_TOKEN>` when documenting commands that normally include secrets.
Allowed credential-adjacent material:
- SSH public keys (`*.pub`);
- public key fingerprints;
- host/user/port/path instructions;
- verification results that do not reveal secrets.
Prefer public-key SSH access over password reuse. Store public keys in `locations/ssh-public-keys/` when useful, but keep private keys and passphrases only on the local machine or in the operating system's secure credential store.