The agent-first logic engine for MontRS.
Target Audiences: Framework Contributors, Agents.
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.
- Context Fragmentation: Aggregates disparate information (source code, READMEs, CLI metadata) into a single, structured
agent.jsonfile. - 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.tomlmanifests and@agent-skillmarkers. - PR Documentation: Parses and validates structured
prdoc.mdfiles for machine-readable pull request context.
- 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).
It acts as a sidecar to the CLI. While the CLI handles the "doing," montrs-agent handles the "describing" and "recording."
- 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.
- 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.jsonis generated by theAgentManagerin this package. - Diff Training: The
errorfilesin this package contain historical diffs of fixed bugs, which are highly valuable for understanding local patterns. - Skill Discovery: Use
discover_skills()to findskill.tomlmanifests andskills_to_tools_json()to convert them to tool specifications. - PRDoc Parsing: Use
parse_prdoc()/load_prdoc()to read structured PR documentation, andvalidate_prdoc()to check schema compliance.