AlexandrAI AGENTS.md
agents-md

LMSSEP CLI Proxy Agent Guide

Project-specific AGENTS.md guidance for the LMSSEP CLI Proxy MCP server, subprocess isolation, token-saving execution, result caching, batch tasks, and log hygiene.

AGENTS.md

Guidance for coding agents working on LMSSEP CLI Proxy, the MCP server that runs Copilot CLI tasks in isolated subprocesses.

Project Overview

CLI Proxy is a token-control layer. Heavy analysis runs in a subprocess with its own context, and the main chat receives a compressed summary or selected result. It supports direct prompts, file-based prompts, result retrieval, semantic history search, tool listing, and batch subagent execution.

Key paths:

  • cli_proxy/README.md: tool contract and examples.
  • cli_proxy/main.py: MCP server entrypoint.
  • cli_proxy/requirements.txt: dependencies.
  • memory/: shared ChromaDB storage used for saved results.
  • logs/: execution logs.
  • output/: generated result files.

Setup Commands

bashcd <project-root>/cli_proxy
pip install -r requirements.txt
python3 main.py

Use placeholders such as <TOOL_NAME>, <PROMPT_FILE>, <RESULT_ID>, and <TIMEOUT_SECONDS> in examples.

Tool Rules

  • run_as_subagent starts an isolated CLI execution.
  • get_subagent_result retrieves a saved result.
  • search_subagent_history uses semantic search over stored executions.
  • list_available_tools reports configured tool names.
  • batch_run_subagents runs several tasks sequentially.

Code Style

  • Keep subprocess setup, config writing, logging, and result persistence separable.
  • Store full logs for local debugging, but return concise summaries by default.
  • Do not assume one fixed downstream MCP tool; tool names must remain configurable.
  • File-based prompts should read only explicit files provided by the caller.

Testing

  • Test timeout, nonzero exit, missing tool, bad prompt file, and successful summary paths.
  • Verify logs show progress without exposing secrets.
  • Verify result retrieval works after process restart when persistence is enabled.

Security

  • Do not store tokens, private prompt files, raw private Slack/Jira/Confluence content, or local absolute paths in public examples.
  • Redact subprocess command lines if they contain credentials.
  • Avoid batch tasks that implicitly read broad local directories.