Extend Midcore
Extend Midcore with project rules, custom skills and commands, lifecycle hooks, and the Model Context Protocol (MCP) for external tools. All of these are optional—the agent works out of the box with sensible defaults.
Rules
Rules are Markdown files the agent reads at session start. They define coding standards, architecture decisions, and review checklists. Place them in:
.midcore/rules/*.mdc— per-topic rules (e.g. one file for API conventions, one for testing)AGENTS.md— project-wide instructions in project root or .midcore/
Example rule content (structure only):
# API conventions
- Use REST for public APIs; validate request bodies with the shared schema.
- Return 4xx for client errors, 5xx only for server failures.
- Document all new endpoints in the OpenAPI spec.
Priority
Skills and commands
Custom commands package repeatable workflows so your team can run them with a single slash command. Examples:
| Command | Purpose |
|---|---|
| /review-pr | Run code review and post feedback |
| /deploy-staging | Run gates, then deploy to staging |
| /add-tests | Generate tests for changed files |
Define commands in your extension or desktop config. Each command maps to a prompt or script the agent executes. See your IDE or CLI docs for the exact configuration format.
Hooks
Hooks run shell commands or scripts before or after agent actions. Use them for formatting, linting, or custom checks. Configuration lives in:
.maestro/hooks.json.midcore/hooks.json
Typical events you can hook into:
- Before or after file edits
- Before or after shell commands
- Session start or end
Security
MCP (Model Context Protocol)
MCP is an open standard for connecting AI tools to external data and APIs. With MCP, Midcore can read design docs, query databases (through a safe adapter), or call your internal APIs. You configure MCP servers in your environment; the agent discovers their tools and uses them when relevant to the task. Setup is environment-specific (CLI vs IDE); see Settings and your platform docs for how to add and authorize MCP servers.
Example: adding a custom rule
Create a file under .midcore/rules/ or add to AGENTS.md:
# .midcore/rules/api-conventions.mdc
- Use REST for public APIs; validate request bodies.
- Return 4xx for client errors, 5xx for server failures.
- Document new endpoints in the OpenAPI spec.Key takeaways
- Rules (AGENTS.md, .midcore/rules) give the agent persistent coding standards and architecture context.
- Skills and commands package repeatable workflows; hooks run before/after agent actions.
- MCP connects external tools and data; configure servers in your environment.
- All extension points are optional; the agent works with sensible defaults.