Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 2.66 KB

File metadata and controls

41 lines (32 loc) · 2.66 KB

montrs-agent

The agent-first logic engine for MontRS.

Target Audiences: Framework Contributors, Agents.

1. What this package is

montrs-agent is the package responsible for making MontRS applications machine-readable. It handles the generation of project snapshots, versioned error tracking, and tool curation.

2. What problems it solves

  • Context Fragmentation: Aggregates disparate information (source code, READMEs, CLI metadata) into a single, structured agent.json file.
  • Debugging Blind Spots: Captures full error context (including compiler output and suggested fixes) into versioned errorfiles.
  • Tool Discovery: Automatically maps CLI commands and package capabilities to agent-native tool specifications.
  • Skill Composition: Discovers and curates multi-step agent capabilities from skill.toml manifests and @agent-skill markers.
  • PR Documentation: Parses and validates structured prdoc.md files for machine-readable pull request context.

3. What it intentionally does NOT do

  • Inference: It does not call models or perform inference; it only prepares the data for them.
  • Code Modification: It provides the data for fixes (diffs) but does not apply them to the source code (the CLI or the developer does that).
  • Core Logic: It does not define how plates or routes work (see montrs-core).

4. How it fits into the MontRS system

It acts as a sidecar to the CLI. While the CLI handles the "doing," montrs-agent handles the "describing" and "recording."

5. When a user should reach for this package

  • When building a custom agent that needs to understand a MontRS project.
  • When extending the framework with new machine-readable metadata.
  • When implementing a new error reporting or diagnostics system.

6. Deeper Documentation

7. Notes for Agents

  • Self-Documentation: This package is the primary source of truth for your own capabilities within a MontRS project.
  • Snapshot Origin: All data in .agent/agent.json is generated by the AgentManager in this package.
  • Diff Training: The errorfiles in this package contain historical diffs of fixed bugs, which are highly valuable for understanding local patterns.
  • Skill Discovery: Use discover_skills() to find skill.toml manifests and skills_to_tools_json() to convert them to tool specifications.
  • PRDoc Parsing: Use parse_prdoc() / load_prdoc() to read structured PR documentation, and validate_prdoc() to check schema compliance.