Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 148 additions & 58 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
# AGENTS.md

This file provides instructions for AI coding agents to interact with this project. It is generated from the project's `Makefile` to ensure it is always up-to-date.
This file provides instructions for AI coding agents to interact with this project.

## Project Overview

This is a Python-based project with a sophisticated, self-correcting agent architecture. The agent's core protocols are managed programmatically. For detailed, machine-readable protocols, refer to the primary `AGENTS.md` file. This `AGENTS.standard.md` file provides a simplified summary for external tools.
This is a Python-based project with a sophisticated, self-correcting agent architecture. The agent's core protocols are managed programmatically. For detailed, machine-readable protocols, please see the JSON block at the end of this file.

## Build & Commands

Expand All @@ -18,32 +14,64 @@ Here are the essential commands for working with this repository.

To install all required Python packages, run:
```bash
$(BUILDER) --target install
make install
```

### Running Tests

To run the full suite of unit tests, use the following command:
```bash
$(BUILDER) --target test
make test
```

## Code Style
### Code Style

This project uses standard Python code quality tools.

### Linting

To check the code for style issues, run the linter:
```bash
$(BUILDER) --target lint
make lint
```

### Formatting

To automatically format the code, run:
```bash
$(BUILDER) --target format
make format
```

### Documentation

To build the project documentation, run:
```bash
make docs
```

To generate the README, run:
```bash
make readme
```

### Auditing and Security

To run the security scanner, use:
```bash
make security
```

To run a full audit of the project, use:
```bash
make audit
```

To audit the documentation, use:
```bash
make audit-docs
```

### Cleaning

To remove all build artifacts and clean the project directory, run:
```bash
make clean
```

## Project Structure
Expand All @@ -52,46 +80,108 @@ $(BUILDER) --target format
- `tooling/`: Scripts for compilation, validation, and other development tasks.
- `knowledge_core/`: Compiled knowledge artifacts used by the agent.

For more detailed information, please consult the `README.md`.

"""

import re
import subprocess

def main():
"""
This script is a self-executing Markdown file.
It parses its own content to find and execute shell commands.
"""
# Use the __doc__ attribute to get the docstring, which is the Markdown content.
markdown_content = __doc__

commands = re.findall(r'```bash\n(.*?)\n```', markdown_content, re.DOTALL)

for command in commands:
# Replace the $(BUILDER) variable with the actual builder command.
command = command.replace("$(BUILDER)", "python3 tooling/builder.py")
print(f"--- Executing: {command.strip()} ---")
try:
result = subprocess.run(
command,
shell=True,
check=True,
capture_output=True,
text=True
)
if result.stdout:
print(result.stdout)
if result.stderr:
print(result.stderr)
except subprocess.CalledProcessError as e:
print(f"--- Command failed with exit code {e.returncode} ---")
if e.stdout:
print(e.stdout)
if e.stderr:
print(e.stderr)
print("--- Done ---")

if __name__ == "__main__":
main()

## Machine-Readable Protocol

The following is a machine-readable protocol that defines the available commands.
Agents should parse this protocol to understand the available actions.

```json
{
"@context": "http://schema.org/",
"@type": "HowTo",
"name": "Agent Protocol for Repository Interaction",
"step": [
{
"@type": "HowToAction",
"name": "test",
"description": "Run the full suite of unit tests.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: test"
}
},
{
"@type": "HowToAction",
"name": "lint",
"description": "Check the code for style issues.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: lint"
}
},
{
"@type": "HowToAction",
"name": "format",
"description": "Format the code using black.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: format"
}
},
{
"@type": "HowToAction",
"name": "install",
"description": "Install Python dependencies.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: install"
}
},
{
"@type": "HowToAction",
"name": "docs",
"description": "Build the project documentation.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: docs"
}
},
{
"@type": "HowToAction",
"name": "readme",
"description": "Generate the README.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: readme"
}
},
{
"@type": "HowToAction",
"name": "security",
"description": "Run the security scanner.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: security"
}
},
{
"@type": "HowToAction",
"name": "audit",
"description": "Run a full audit of the project.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: audit"
}
},
{
"@type": "HowToAction",
"name": "audit-docs",
"description": "Audit the documentation.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: audit-docs"
}
},
{
"@type": "HowToAction",
"name": "clean",
"description": "Remove all build artifacts and clean the project directory.",
"instrument": {
"@type": "HowToTool",
"name": "Makefile Target: clean"
}
}
]
}
```
56 changes: 43 additions & 13 deletions AGENTS.standard.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# AGENTS.md

This file provides instructions for AI coding agents to interact with this project. It is generated from the project's `Makefile` to ensure it is always up-to-date.
This file provides instructions for AI coding agents to interact with this project.

## Project Overview

This is a Python-based project with a sophisticated, self-correcting agent architecture. The agent's core protocols are managed programmatically. For detailed, machine-readable protocols, refer to the primary `AGENTS.md` file. This `AGENTS.standard.md` file provides a simplified summary for external tools.
This is a Python-based project with a sophisticated, self-correcting agent architecture. The agent's core protocols are managed programmatically. For detailed, machine-readable protocols, please see the JSON block at the end of this file.

## Build & Commands

Expand All @@ -14,38 +14,68 @@ Here are the essential commands for working with this repository.

To install all required Python packages, run:
```bash
$(BUILDER) --target install
make install
```

### Running Tests

To run the full suite of unit tests, use the following command:
```bash
$(BUILDER) --target test
make test
```

## Code Style
### Code Style

This project uses standard Python code quality tools.

### Linting

To check the code for style issues, run the linter:
```bash
$(BUILDER) --target lint
make lint
```

### Formatting

To automatically format the code, run:
```bash
$(BUILDER) --target format
make format
```

### Documentation

To build the project documentation, run:
```bash
make docs
```

To generate the README, run:
```bash
make readme
```

### Auditing and Security

To run the security scanner, use:
```bash
make security
```

To run a full audit of the project, use:
```bash
make audit
```

To audit the documentation, use:
```bash
make audit-docs
```

### Cleaning

To remove all build artifacts and clean the project directory, run:
```bash
make clean
```

## Project Structure

- `protocols/`: Source files for the agent's governing protocols.
- `tooling/`: Scripts for compilation, validation, and other development tasks.
- `knowledge_core/`: Compiled knowledge artifacts used by the agent.

For more detailed information, please consult the `README.md`.
Loading