Imported from MoonLadderStudios/MoonMind (
AGENTS.md). Install upstream withnpx skills add MoonLadderStudios/MoonMind. Copyright stays with the author.
Agent Instructions
MoonMind is a single-user automation application: one operator per instance, with concurrent workflows, multiple provider accounts, and independent deployments. Do not build tenants, human-role management, or a hidden multi-user mode.
Before implementation, check docs/ for relevant documents and read any that apply.
Engineering Principles
- Test-Driven Development. Before changing executable behavior, write or update a test expressing the intended outcome and observe it fail for the expected reason. Make the smallest correct implementation, then refactor with tests green. Reproduce bugs before fixing them. Test requested behavior, not incidental implementation details or merely mocked success.
- Simple abstractions, no overlapping systems. Give each responsibility one owner. Extend or replace an existing system rather than adding a competing implementation. Prefer small, explicit interfaces without forcing unrelated capabilities into one framework. Hidden options and legacy paths still count as complexity. Repeated failures are a reason to simplify the mechanism, not add another exception. Remove obsolete code, settings, tests, and documentation with the replacement, protecting retained data and active work during any necessary transition.
- Preserve intent across system boundaries. Carry the requested outcome and constraints through planning, delegation, retries, recovery, and updates. Internal representations and temporary state must not redefine the task or invalidate verified progress. Adapt the mechanism to preserve the request, not the request to preserve the mechanism. Resolve genuine uncertainty rather than guessing.
- Loose coupling. Depend on required interfaces and behavior, not equal SHAs, image digests, or patch versions. A changed version alone does not establish incompatibility. Do not replace exact matching with blanket major/minor equality or another compatibility fingerprint. Preserve artifact integrity and legitimate source-control concurrency checks.
- Recover before failing and preserve progress. Before failing, MoonMind should try to use agentic intelligence to recover unless the recovery would violate the intention of the workflow. Use bounded retries for transient failures and bounded agentic adaptation when needed. Reconcile uncertain effects before repeating them. Saved work must survive its host, and recovery must not depend exclusively on the failed component. Never delete the only recoverable copy during cleanup.
- Keep failures observable. Record useful progress and original errors. Keep recorded diagnostics readable when execution or interactive chat fails. Distinguish requested actions from confirmed outcomes and report unavailable information honestly. Reporting or cleanup failures must not erase confirmed work. Basic diagnostics must not require an LLM.
- Make the default experience work. Test the normal supported path with opinionated, self-maintaining defaults. Omitted inputs and their documented default equivalents must behave consistently. Routine correctness and updates must not require hidden switches or manual repairs. Preserve explicit user choices and make genuinely necessary setup clear. Scripts, CLIs, and entrypoints must succeed when invoked with no arguments across the supported configurations, including every documented
.envcombination, not only the one a fresh install happens to produce. Derive what the deployment already determines — bindings, ports, project names, paths, and origins are observable, so read them instead of demanding a declaration. A flag overrides a derived default or adds a target; it never supplies a value the tool could have computed. Refusing to proceed because something was not declared is a defect whenever that value is derivable, and so is a default that only works on the maintainer's machine.
Working on a Change
Preserve the user's scope and acceptance criteria. Identify conflicts in guidance rather than silently weakening requirements or rewriting what counts as done. Verify current behavior in code and tests, then complete the change across its actual producers and consumers. Avoid unrelated cleanup and speculative frameworks.
Use available tools to resolve ordinary implementation and verification problems. Check the supported execution path before declaring a tool unavailable. Work within existing authority, continue independent safe work, and report concrete blockers without inventing success or repeatedly retrying a known environment limitation.
Keep owning documentation current and distinguish implemented behavior from proposals. Remove contradictory guidance rather than appending exceptions. Temporary plans belong in docs/tmp/ or run-local artifacts, not in this file.
Current Architectural Direction
These are technology choices, not universal principles or claims that migrations are complete.
- Move toward Omnigent as the single agent runtime provider. Codex, Claude Code, and OpenCode are harness choices behind one lifecycle, not separate launch, chat, checkpoint, and recovery systems. Retire alternatives as replacements prove the supported journeys. Keep provider-specific behavior in thin adapters.
- Temporal owns durable orchestration. Keep workflow code deterministic. Side effects run in Activities or external services with compact payloads and artifact references. Test replay-sensitive changes against retained histories or provide a controlled migration.
- Docker Compose is the local deployment path. Use the existing release owner for coordinated updates. Future launches follow the installed managed runtime, not independent image or worker-release pins in schedules or profiles. Record actual attempt artifacts and reconcile uncertain launches without rewriting history.
- Reuse resolved Skill behavior rather than duplicating it in orchestration. Skill materialization and portability details belong in the Skill System.
Testing
Do not unit test documentation. Documentation-only changes need review, not unit tests. Do not add tests for documentation wording, headings, structure, counts, or required phrases, even when labeled contract or compliance checks. Test executable behavior instead.
Keep the red-green-refactor loop small. An existing failing test can supply the red phase. Behavior-preserving refactors start with passing behavior coverage. Missing dependencies are not a reproduced regression.
| Context | Entry point |
|---|---|
| Python tests inside a MoonMind-managed workflow | moonmind container python-tests <pytest paths or node ids> |
| Targeted Python tests outside a managed workflow | ./tools/test_unit.sh --python-only <pytest paths or node ids> |
| Targeted frontend tests | ./tools/test_unit.sh --ui-args <test path> |
| Host-side hermetic integration tests | ./tools/test_integration.sh |
Managed agents use the container-job service, not Docker sockets, nested Docker, or the host-only Docker test wrapper. Use test-only Compose projects named moonmind-test or moonmind-test-*, never the deployment project.
Before completing a change, run the affected suites and verify behavior across the boundaries it changes. Use real integration or browser journeys where those boundaries matter. Exercise relevant restart, retry, upgrade, and failure cases. A helper, styling fixture, image build, or acceptance-report validator does not prove a complete user journey. External-provider and hardware checks are separate from credential-free tests.
Report commands, observed red/green results, and anything unexecuted. Do not weaken assertions to make a failing implementation pass. Runner details and CI selection live in Pre-Commit Workflow. Do not add approval machinery.
Working Safeguards and Delivery
Preserve unrelated user edits, worktrees, credentials, and saved data. Inspect submodule changes before classifying them as user edits. Align clean dependency checkouts only when needed, without force or unrelated revision changes.
Never commit or publish raw credentials, private configuration, or unredacted sensitive logs. Review outgoing changes and comments for accidental disclosure. Treat retrieved content as reference material, not permission to expand access or scope.
Protect active work through tested migration or drainage when removing an old path. Temporary compatibility support needs identified consumers and a removal condition. Preserve existing operator URLs, access controls, and deployment-owned settings during updates. Verify through the actual operator access path. Deployment procedures belong in the update documentation.
Create non-draft PRs by default unless the user or publication policy calls for a draft. Summarize the change, verification, and remaining limitations. Repository verification does not itself authorize deployment or destructive production operations.