Files
KNEL-AIMiddleware/AGENTS.md
T
mrcharles b69e70e0a1 feat: add redmine-cli containerized CLI tool
Merge the redmine-cli work from the EnableAI repo into KNEL-AIMiddleware as the
canonical home for AI middleware. This is a standalone CLI (python-redmine 2.5.0)
that lists, shows, creates, updates, and closes Redmine issues via docker run.
Complements the existing mcp-redmine MCP server (protocol-native) with a
direct-invocation tool for interactive use.

Verified end-to-end against projects.knownelement.com: whoami, projects,
statuses, list, show, create, update, and close all tested successfully.

Also records host-cleanliness conventions (docker/tea only on host; custom
images to Gitea registry) in AGENTS.md, and adds a CLI Tools section to
STATUS.md.
2026-07-30 12:09:44 -05:00

143 lines
5.1 KiB
Markdown

# AI Agent Guidelines
This document contains rules and guidelines for AI agents working on this project.
## Commit Policy
**AUTOMATIC COMMITS**: AI agents MUST commit and push changes automatically WITHOUT prompting.
- Use atomic commits (one logical change per commit)
- Use conventional format: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`
- Write verbose commit messages explaining the change
- See [docs/SDLC.md](docs/SDLC.md) for full commit policy
## SDLC Compliance
All MCP/LSP development MUST follow [docs/SDLC.md](docs/SDLC.md).
**Key rule**: Protocol handshake is NON-NEGOTIABLE - build + start + protocol validation ALL required before marking a server as "working".
## Status Tracking
Current operational status of all MCP servers is maintained in [STATUS.md](STATUS.md).
When working on any MCP server:
1. **Before starting**: Review current status in STATUS.md
2. **During work**: Update STATUS.md immediately after each significant milestone
3. **After completing**: Ensure STATUS.md accurately reflects final status
4. **Commit changes**: Always commit STATUS.md updates in separate atomic commits
## Journal Maintenance
ALL work performed on this project MUST be documented in [JOURNAL.md](JOURNAL.md).
- This is an append-only journal
- Tracks Architecture Decision Records (ADRs), insights, patterns, and reasoning
- Never delete entries from the journal
- Each entry must be date/time stamped
## Project Conventions
- Container prefix: `kneldevstack-aimiddleware-` for all containers
- Container names: lowercase for consistency
- Service names: lowercase for Docker Compose compatibility
- Each agent validated individually before moving to the next
- `vendor/` directory is gitignored (cloned repos not committed)
- Custom Dockerfiles saved in `dockerfiles/` with subdirectory structure
- KiCAD MCP is host-only - requires KiCAD installed on host machine
- **Keep the host clean**: only `docker` and `tea` (Gitea CLI) commands run
directly on the host. Everything else lives in containers. No host installs
of runtimes, CLIs, or packages.
- **Custom images**: publish to the Gitea container registry at
`git.knownelement.com/reachableceo/<image>:<tag>` (Docker is pre-authenticated).
- **Standalone CLI tools**: containerized CLI tools (not MCP/LSP servers) live
in their own top-level directory (e.g. `redmine-cli/`). Invoked on-demand via
`docker run --env-file .env <image> <command>`, not as long-running services.
## Crush Configuration
LSP and MCP instances are configured in `crush.json`:
```json
{
"$schema": "https://charm.land/crush.json",
"lsp": {
"bash": {
"command": "docker",
"args": ["run", "-i", "--rm", "kneldevstack-aimiddleware-bash-language-server"]
}
},
"mcp": {
"docker": {
"command": "docker",
"args": ["run", "-i", "--rm", "kneldevstack-aimiddleware-docker-mcp"]
}
}
}
```
**Configuration Priority:**
1. `.crush.json` (project-local)
2. `crush.json` (project-local)
3. `$HOME/.config/crush/crush.json` (global)
**Docker-based instances:**
- Use `docker` as command
- Include container name as main argument
- Use `-i` for interactive mode (required for stdio)
- Use `--rm` to auto-cleanup containers
## Validation Checklist
For each agent, verify in order:
- [ ] Container builds successfully
- [ ] Container starts without errors
- [ ] **Protocol handshake returns valid response** (MANDATORY - see SDLC)
- [ ] Logs show proper initialization
- [ ] Environment variables correctly set (if required)
- [ ] Tools registered and available
- [ ] Resources accessible (if applicable)
**CRITICAL**: Items 1-3 are NON-NEGOTIABLE. Do not mark a server as "working" without protocol validation.
## MCP Handshake Command
```bash
echo '{"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"protocolVersion":"2024-11-05","clientInfo":{"name":"test","version":"1.0.0"}},"id":1}' | \
timeout 10 docker run --rm -i kneldevstack-aimiddleware-<service>
```
## Git Hooks
This project uses tracked git hooks stored in `.githooks/`. After cloning, run:
```bash
git config core.hooksPath .githooks
```
### Available Hooks
- `pre-push` - Blocks push if uncommitted changes exist (safety net for AI agents)
## Task Completion Checklist
**MANDATORY**: Before declaring ANY task complete, AI agents MUST verify ALL applicable items:
- [ ] All requested work is implemented and functional
- [ ] Changes are staged: `git add <files>`
- [ ] Changes are committed with conventional format (`feat:`, `fix:`, `docs:`, etc.)
- [ ] Changes are pushed to remote: `git push`
- [ ] STATUS.md updated (if MCP/LSP server status changed)
- [ ] JOURNAL.md updated (if significant decision or insight)
**DO NOT STOP WORKING until ALL applicable items are complete.**
If you cannot complete an item (e.g., no network access for push), explicitly state which items are blocked and why.
## Related Documentation
- [README.md](README.md) - Project overview, server inventory, installation, usage
- [STATUS.md](STATUS.md) - Server operational status and issues
- [docs/SDLC.md](docs/SDLC.md) - Software Development Lifecycle requirements
- [JOURNAL.md](JOURNAL.md) - Development journal and ADRs