# Install the Memrail skill

These instructions are for a coding agent whose user has explicitly requested installation. Reading this page alone does not authorize writes, dependency installation, an audit, or implementation.

## Scope

Install **only the complete Memrail skill** for the client the user is using. Preserve existing skills. Do not install the Python or TypeScript SDK, edit a repository, configure credentials, or register Memrail policy unless the user separately requests it.

The official source is https://github.com/cadenzai/memrail-claude-plugin. Its `skills/memrail/` folder is already a portable Agent Skills package: `SKILL.md` plus all of `references/`. The rest of the Claude plugin is not required for a standalone skill install.

## Identify the client and destination

Use your actual client identity and configuration, not whichever unrelated CLI is first on PATH. If uncertain, ask which client the user wants.

| Client | Installer flag | Default destination |
|---|---|---|
| Codex | `--agent codex` | `~/.agents/skills/memrail/` |
| Claude Code | `--agent claude` | `~/.claude/skills/memrail/` |
| OpenCode | `--agent opencode` | `~/.config/opencode/skills/memrail/` |

Confirm custom configuration and installed-client support before writing. Claude uses `CLAUDE_CONFIG_DIR` when set. OpenCode also discovers shared `.agents/skills` and `.claude/skills`; check for an existing complete skill there before adding a duplicate. For project scope, custom paths, or another supported client, use `--dir` with an absolute skills parent; do not add repository files without authorization.

Client references: [Codex](https://learn.chatgpt.com/docs/build-skills), [Claude Code](https://code.claude.com/docs/en/skills), [OpenCode](https://opencode.ai/docs/skills/).

## Review and install

Explain the destination and skill-only scope. If authorized, download the installer into a fresh temporary directory, inspect its contents, and run it for the chosen client. This example is for Codex; substitute the correct flag:

```bash
memrail_setup="$(mktemp -d)"
curl -fsSL https://docs.memrail.com/install.sh -o "$memrail_setup/install.sh"
sh "$memrail_setup/install.sh" --agent codex --dry-run
sh "$memrail_setup/install.sh" --agent codex
```

Read the downloaded script before executing it. It pins the official skill archive to a commit and verifies its SHA-256. It installs the complete folder at the selected destination; no plugin conversion is needed. Default auto-detection is only a convenience for humans with one installed client. Agents should pass an explicit choice.

If a skill already exists, report its location and inspect it rather than automatically replacing it. Use `--replace` only when the user authorizes replacing the existing skill. That option preserves the old copy under `~/.local/state/memrail/skill-backups/`, outside normal discovery paths, and prints the backup location. Do not remove other clients' copies.

If you cannot fetch or execute the installer, give the user the [human installation guide](https://docs.memrail.com/agents/). A manual alternative is to inspect the official repository, select a trusted revision, and copy its entire `skills/memrail` directory into the chosen client's documented location, refusing to overwrite an existing copy. Do not claim success without filesystem evidence.

## Verify

1. Report the exact installed directory and confirm `SKILL.md` exists there.
2. Confirm its `references/` directory and all files linked from `SKILL.md` are present. Do not substitute verification of another client's installation.
3. Read `SKILL.md` completely before Memrail work. Read each task-relevant reference it selects completely too.
4. If the client does not discover the new skill, reload or restart it, then check discovery and skill permissions. Distinguish files installed from skill actually loaded.
5. Stop after installation and verification unless the user requested a subsequent task. Never expose credentials in the report.

## Optional SDK installation

Only when requested, install the application dependency using its existing package manager. Python projects use `memrail`; TypeScript projects use `@memrail/sdk`. Do not infer a Python dependency from a skill-install request.

For a Python 3.9+ project with an active virtualenv, the installer supports `--with-sdk` alongside the selected `--agent`. It uses that virtualenv's pip or explicitly targeted `uv pip`; it does not create an environment or update dependency manifests. Verify the import and package version inside the same project environment. If the SDK step fails, the skill may already be installed; report partial completion and do not blindly replace it.

Before implementing an integration, read the [integration invariants](https://docs.memrail.com/concepts/#integration-invariants) and the reference for the project's SDK.

## First safe task

If the user asked for an audit but did not authorize implementation, perform a read-only topology audit. Do not edit code, register EMUs, change external services, or expose credentials.

Map:

- consequential decision points and hidden model authority;
- state, tag, and event sources;
- trigger reachability and value reachability;
- action executors, routes, prompts, and connectivity gaps;
- project coherence and bypass paths;
- safe seams for incremental migration.

Return evidence with file and symbol locations, distinguish facts from inferences, and wait for approval before implementing.

## Integration requirements

- Use `decide(context=..., decision_point="your.point")` in Python and `decide({ context, decisionPoint: 'your.point' })` in TypeScript. Bind each EMU to that same name.
- Use modern lowercase dot-notation keys and uppercase DSL operators.
- Every production `tool_call` includes `tool.version`.
- Manage production EMUs with `emu-pull`, `emu-plan`, and `emu-apply` JSONL workflow.
- Check trigger reachability and action connectivity before deployment.
- Enforce same-project tool availability in the application's deployment and execution contract; a registered tool is not a runtime authorization guarantee.
- Use an isolated project for integration-test fixtures.
- Validate model-derived categories at runtime, not only with Python `Literal` or TypeScript annotations.
- Apply the linked integration contract to evaluation, execution, and outcome recording.

## Integration contract

Use named `decision_point` bindings and follow the [integration invariants](https://docs.memrail.com/concepts/#integration-invariants). Validate policy structure with the [EMU schema](https://docs.memrail.com/schemas/emu.schema.json), interpret the [diagnostic catalog](https://docs.memrail.com/reference/diagnostic-codes.json), and start from the [complete runnable example](https://docs.memrail.com/getting-started/).

Canonical human installation guide: https://docs.memrail.com/agents/
