Added agent contracts to allow for more automation of work in repo

This commit is contained in:
2026-06-30 16:22:51 +01:00
parent e182c6d945
commit 108f22cf95
12 changed files with 103 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
---
description: "Imports the Master AGENTS.md context."
alwaysApply: true
---
# AGENTS.md Integration
- You are working in the I-Form Invenio project.
- ALWAYS prioritize the instructions defined in `AGENTS.md` in the project root.
- If a conflict arises between this local rule and `AGENTS.md`, `AGENTS.md` is
the source of truth.
+17
View File
@@ -0,0 +1,17 @@
---
description: "Strict behavioral guardrails for safety and iteration limits."
alwaysApply: true
---
# Agent Iteration & Safety Guardrails
- **Strict Iteration Limit:** You are permitted a maximum of 3 tool calls to
solve a problem. If tests/linters fail after 3 attempts, you MUST stop
execution, summarize the failure, and wait for human input. Do NOT attempt a
4th fix.
- **No Blind Retries:** If a tool call fails, do NOT immediately retry with the
exact same arguments. Change your approach or ask the user.
- **Destructive Action Halt:** NEVER run `rm -rf`, `git reset --hard`, or drop
database tables without explicit user confirmation.
- **No Git Operations:** Do not use `git` to sync or commit changes unless
explicitly told to. The human is the final QC step.
+17
View File
@@ -0,0 +1,17 @@
---
description: "Core context for the I-Form Invenio RDM repository. Use this when reasoning about architecture, deployment, or advanced manufacturing requirements."
alwaysApply: false
---
# I-Form Invenio Repository Context
- **Goal:** Set up a reliable, customized Invenio instance for the Irish
"I-Form" research institution (advanced manufacturing / Powder Bed Fusion).
- **Scale:** The system must handle extreme volumes of data and remain highly
reconfigurable.
- **Tooling:** `uv` is used for environment/dependency management.
- **Containers:** All changes must be completely OCI compatible. We use podman
locally, but deployment could be Docker or podman.
- **Upstream References:** The packages `invenio-config-iform` and
`invenio-theme-iform` were forked from `invenio-config-tugraz` and
`invenio-theme-tugraz`.
+17
View File
@@ -0,0 +1,17 @@
---
description: "Strict LSP and syntax validation rules."
globs: ["**/*.py"]
alwaysApply: false
---
# Python Validation & Editing Rules
- **Mandatory Planning:** Before modifying any files, you must outline the files
you intend to touch.
- **LSP Checking:** After editing or removing boilerplate, you MUST query the
LSP server (e.g., ruff) to check for broken references, undefined variables,
or unused imports.
- **Zero Warnings:** The file is not considered "clean" until the LSP returns
zero warnings for the section you modified.
- **Revert on Failure:** If your cleanup causes cascading errors in other files,
revert your change and ask the user how they want to proceed.
+13
View File
@@ -0,0 +1,13 @@
---
description: "Workflow for documenting agent actions and handoffs."
alwaysApply: false
---
# Agent Logging & Handoff Protocol
When you complete a major task, fail a task, or require a human handoff, you
must update the following files in the `gemini/` directory: -
**`gemini/history.md`**: Update this living log with your past executions,
discoveries, bug fixes, and system status. - **`gemini/handoff.md`**: If passing
control back to a human or another agent, update this with active problems,
proposed solutions, and immediate next steps.
+1
View File
@@ -0,0 +1 @@
/home/cianh/Storage/Programming/Work_Projects/iform-invenio/.agents/rules/00-master-import.md
+1
View File
@@ -0,0 +1 @@
/home/cianh/Storage/Programming/Work_Projects/iform-invenio/.agents/rules/01-guardrails.md
+1
View File
@@ -0,0 +1 @@
/home/cianh/Storage/Programming/Work_Projects/iform-invenio/.agents/rules/02-project-context.md
+1
View File
@@ -0,0 +1 @@
/home/cianh/Storage/Programming/Work_Projects/iform-invenio/.agents/rules/03-python-validation.md
+1
View File
@@ -0,0 +1 @@
/home/cianh/Storage/Programming/Work_Projects/iform-invenio/.agents/rules/04-logging.md
+1
View File
@@ -47,3 +47,4 @@ versions
secrets.env
.env
agents
+22
View File
@@ -0,0 +1,22 @@
# I-Form Invenio Repository - AGENTS.md
## Project Identity
- **Goal:** Manage a customized Invenio RDM instance for I-Form research.
- **Scale:** High-volume data, extreme reconfigurability.
- **Tech Stack:** Invenio RDM, Python, OCI-compliant (Docker/Podman).
## Core Principles
1. **Human-in-the-Loop:** Do not perform git commits or destructive database
actions without explicit human approval.
2. **Deterministic Tooling:** Always prefer `uv` for environment management.
3. **Safety First:** If a tool/command fails, stop and report. Do not blindly
retry.
4. **Tool Integrity:** Use `sequential-thinking` for planning and `LSP`
(ruff/typescript) for validation.
## Records
- All agent logs must be synced to `agents/history.md`.
- All handoffs must be documented in `agents/handoff.md`.