Define tooling once, enable per repo, emit client-native artifacts deterministically.
If you're new, start here:
docs/content/docs/quickstart.mdx— fastest path (no Nix)docs/content/docs/beginner-path.mdx— simple day-one habitdocs/content/docs/success-checks.mdx— how to verify it worked
Advanced docs are in the same folder (packs, safety, advanced).
- Dotfiles-first config (
programs.replix.*) - Pack-first distribution with per-repo enable selectors
- Multi-client emitters: Claude, OpenCode, Codex, MCP
- Idempotent output + cleanup ownership
- Reliability gates (lock drift, checksum/signature, doctor, golden gate)
- Define packs/skills/MCP/artifacts in dotfiles.
- In repo flake, call
replix.lib.mkRepoand setenable.*selectors. - Run Replix to emit
.claude/*,.opencode/*,.codex/*,.mcp.json. - Lock + doctor keep outputs reproducible and safe.
# ~/.config/home-manager/replix.nix
{
inputs.replix.url = "github:imrane/replix";
imports = [ replix.homeManagerModules.default ];
programs.replix = {
enable = true;
# pack-first
packs = [
{ source = "github:your-org/replix-pack?rev=<sha>"; }
{ source = "path:~/.config/replix/packs/internal"; }
# DX alias: source + folder/folders (normalized to github ?include=...)
# lets you pull specific pack directories from one repo without long URLs.
{
source = "github:imrane/replix";
folders = [
"fixtures/packs/examples/starter"
"fixtures/packs/examples/security"
];
allowUnpinned = true;
}
# Alias import via repo index (replix.index.json):
# { "packs": { "starter": "fixtures/packs/examples/starter" } }
{ source = "github:imrane/replix"; pack = "starter"; allowUnpinned = true; }
];
# You can inspect aliases before using them:
# replix pack list-aliases github:imrane/replix
# optional direct overrides
skills.humanizer.source = "github:blader/humanizer?rev=<sha>";
mcp.filesystem = {
command = "npx";
args = ["-y" "@modelcontextprotocol/server-filesystem" "${ENV:FS_ROOT}"];
};
# client-agnostic artifact namespace
artifacts.commands."review.md" = {
source = "path:~/.config/replix/artifacts/commands/review.md";
};
vars = { FS_ROOT = "/home/your-user"; };
strictEnv = true;
};
}Merge order: packs < direct dotfiles defs on key collision.
{
inputs.replix.url = "github:imrane/replix";
outputs = { replix, ... }: {
devShells.x86_64-linux.default = replix.lib.mkRepo {
system = "x86_64-linux";
clients = [ "claude" "opencode" "codex" ];
enable = {
skills = [ "humanizer" ];
mcp = [ "filesystem" ];
commands = [ "review.md" ];
hooks = [ "pre-commit.sh" ];
agents = [ "security.md" ];
settings = [ "settings" "settingsLocal" ];
};
};
};
}Then:
nix developA canonical pack must define pack.json with:
specVersion: "replix.canonical.v1-draft"referencesmap (source of truth for what to compile)
Example references:
{
"references": {
"skills": ["skills/reviewer/SKILL.md"],
"commands": ["commands/review-pr.md"],
"agents": ["agents/reviewer.md"],
"hooks": ["hooks/before-tool.json"],
"mcp": ["mcp/servers.json"]
}
}Files are still stored under pack folders (skills/, commands/, agents/, hooks/, mcp/), but compilation reads references first and validates file existence/type.
In-repo examples:
fixtures/packs/examples/starterfixtures/packs/examples/securityfixtures/packs/examples/contentfixtures/packs/examples/dataops
Primary selectors in enable:
skills,mcp,commands,hooks,agents,settings
Artifact authoring namespace in dotfiles:
artifacts.commands,artifacts.hooks,artifacts.agents,artifacts.settings,artifacts.settingsLocal
Legacy claude.* artifacts are accepted for compatibility.
| Client | Output |
|---|---|
| Claude | .claude/skills/*, .claude/commands/*, .claude/hooks/*, .claude/agents/*, .claude/settings.json, .claude/settings.local.json |
| OpenCode | .opencode/skills/*, .opencode/command/*, .opencode/hooks/*, .opencode/agent/*, opencode.json |
| Codex | .codex/config.toml, .agents/skills/* |
| MCP | .mcp.json |
Canonical MCP is compiled once, then emitted to all client-native targets.
Templates:
${PROJECT_ROOT}${VAR}${ENV:VAR}
Resolution precedence (high → low):
- repo config
vars - dotfiles
programs.replix.vars - file-backed vars
- process env
File-backed sources:
<repo>/.replix/vars/<VAR_NAME>/run/secrets/<VAR_NAME>/var/run/secrets/<VAR_NAME>*_FILEenv pointers (e.g.API_TOKEN_FILE=/run/secrets/API_TOKEN)
strictEnv=true (default) blocks unresolved vars.
Packs can declare required and optional variables in pack.json:
{
"varsSchemaVersion": 1,
"vars": {
"required": {
"API_TOKEN": { "secret": true, "description": "API authentication token" },
"API_HOST": { "default": "api.example.com", "description": "API hostname" }
},
"optional": {
"WEBHOOK_SECRET": { "secret": true }
}
}
}secret: true— value is never printed inreplix doctoroutput (source is shown, not value)default— used when the var is not set; supports${OTHER_VAR}interpolationreplix doctorreports readiness and fix hints per var; blocks when required vars are missing
# Bootstrap
replix init --client claude --with-lock
# Emit + verify
replix --config .replix/repo.json
replix check --config .replix/repo.json
replix doctor --config .replix/repo.json
# Locking
replix lock update
# Non-Nix pack lifecycle (repo-local .replix/packs.json)
replix add github:owner/repo?rev=<sha>
replix add github:owner/repo?rev=<sha> --dry-run
replix add clawhub:<id>
replix add https://clawhub.ai/items/<slug>
replix add "test runner"
replix pack install github:owner/repo?rev=<sha>
replix pack list
replix pack uninstall github:owner/repo?rev=<sha>
replix pack upgrade
# Provider discovery
replix search --query "security"
replix browse --query "security"
# Reliability + support
replix support bundle
replix registry build [--out <dir>]
# Canonical compile + validation gates
replix compile canonical --client <claude|opencode|codex> [--pack <path>] [--fail-on-warn]
replix spec validate-canonical-pack [--pack <path>]
replix spec validate-client-shapes [--max-age-days N]
# Self-healing compile loop (TS-first AI hook)
replix compile self-heal --config .replix/repo.json --max-attempts 3 \
--client <claude|opencode|codex> --client-log <path> \
--ai-fix-ts <script.ts>
# Discovery/helpers
replix list skills [--config <path>]
replix list mcp [--config <path>]
replix snippet --skills a,b --mcp x,y
replix spec compile --in <snapshot.json> --out <schema.json>replix.lock.jsoncaptures pack version/rev/required vars/checksum- Runtime compatibility gate blocks drift until
replix lock update - Optional pack signatures:
- set
signaturePublicKeyin pack source config - include
pack.sigin pack root - lock/update verifies signature over integrity checksum
- set
- Structured ops log:
.replix/logs/events.ndjson - Client-specific self-heal log parsers in plugins (
src/clientPlugins/*/selfHealLog.ts) - Support snapshot:
replix support bundle→.replix/support/*.json - Static pack registry:
replix registry build→index.html+index.json - Canonical compile quality gates: warning summary +
--fail-on-warn - Canonical pack validator + client shape provenance validator
- Golden release gate script + CI workflow for Linux/macOS
- Author canonical pack only (
specVersion+referencesinpack.json). - Compile plan per client with
replix compile canonical --client .... - Gate quality using
--fail-on-warnin CI. - Validate canonical shape (
replix spec validate-canonical-pack). - Validate client snapshot provenance/freshness (
replix spec validate-client-shapes). - Run bounded self-heal (
replix compile self-heal ... --ai-fix-ts ...) when compilation/runtime issues appear. - Escalate to human when loop can’t recover within max attempts (see
.replix/self-heal/last-report.json).
- ✅ v2 config mode is primary
- ✅ Pack-first registry enabled (
programs.replix.packs) - ✅ Non-Nix lifecycle supported via
.replix/packs.json - ✅ Lock/checksum/signature reliability gates active
- ✅ Support bundle + structured logs + static registry generator shipped
- ✅ Golden reliability gate shipped (
scripts/release-gate.ts, workflow) - ✅ Import-anything foundations shipped:
- provider plugin system (built-ins + external modules)
replix searchacross providers with security/trust indicators- persistent third-party index cache (
.replix/import-index.json) + stale-while-revalidate behavior - friendly
replix addinputs: provider IDs, ClawHub/Playbooks links, plain search terms replix add --dry-runpreview (no writes)- interactive
replix browseTUI (j/k/arrows, space, enter,/filter) - trust policy guardrail (blocks high-risk installs unless
--allow-risky)
- ✅ Pack vars contract:
secret: truepropagated through resolution + doctor output (no value leakage) - ✅ Client shape snapshots: proactive warning zone (20d) + actionable refresh checklist via
replix spec validate-client-shapes ⚠️ Legacy repo-localpack.jsonfallback remains compatibility-only (planned removal)
See PRD.md for roadmap and AGENTS.md for handoff state.
bun test
bun run test:coverage
bun run test:release-gate
nix flake checkOptional gated suites:
REPLIX_CLIENT_SMOKE=1REPLIX_NIX_SMOKE=1REPLIX_GITHUB_INTEGRATION=1
Only these markdown files are allowed:
README.mdPRD.mdAGENTS.md
Use beads (bd) for all other notes/tasks.
MIT