Who is this for? Active contributors and maintainers. When should I read this? After CONTRIBUTING.md. Before making your first change.
At a glance — the steps below expand each stage:
fork/clone → branch → edit → validate → push → PR
-
Prepare local Rosetta repository.
- Fork the repository entirely and work in the
mainbranch - Clone and create a feature branch from
main(use descriptive branch names) - Rosetta uses
mainas the target branch for every PR - Commit messages: short summary line, body if needed. No special format enforced.
- Fork the repository entirely and work in the
-
Develop Rosetta using claude code / codex / cursor or use the prompting flow.
-
Development: use rosetta plugins to develop rosetta. TESTING-PLUGINS.md shows how to install/test plugins locally. Plugins allow contributors to see their in-progress instruction changes reflected almost immediately. End users should use plugins built from
mainor the production MCP endpoints. -
Prompting: use the
coding-agents-prompting-flowwith thecoding-agents-prompt-authoringskill to author, design, refactor, harden, and modernize prompt families (agents, skills, workflows, workflow phases, rules). It understands Rosetta internals. Use it with the Opus 4.8 model.Example invocations:
-
Run the flow by slash-command (requires the plugin installed — see Plugins):
/coding-agents-prompting-flow to author a new R3 Rosetta <skill/agent/workflow/rule/prompt family> `<name>`: <description of what it should be> -
Refactor an old prompt into the new format using local instructions:
MUST FULLY EXECUTE `instructions/r3/core/workflows/coding-agents-prompting-flow.md` to refactor old Rosetta prompt `<prompt full path>` as R3 prompt family in Rosetta. -
Author a new prompt using local instructions:
MUST FULLY EXECUTE `instructions/r3/core/workflows/coding-agents-prompting-flow.md` to author a new R3 Rosetta <skill/agent/workflow/rule/prompt family> `<name>`: <description of what it should be> -
Author a new prompt via Rosetta MCP:
MUST USE FLOW coding-agents-prompting-flow.md to author a new R3 Rosetta <skill/agent/workflow/rule/prompt family> `<name>`: <description of what it should be>
Include in every prompt-change PR: a prompt brief (goal, non-goals, constraints), before/after behavior examples, and validation evidence (attach to the PR description).
Automated review pipelines run on prompt-change PRs — static AI review (structure, quality, correctness, governance) and scenario comparison (runs scenarios with the old and new prompts, then validates the behavioral difference). Both must pass before merge.
-
-
-
Check your output.
-
Test locally on a target repo.
- Disable Rosetta MCP
- Set up Local Instructions Mode on target repository.
- Test your prompts against a real codebase.
- Modify your prompts in
instructionsin target repository - Restart coding agents or new sessions after changes made
- Copy back changed files to the Rosetta repository
-
Test on DEV environment.
- Uninstall
local-files-mode.mdfrom target repository - Publish to dev
- Enable Rosetta MCP or follow Quick Start Guide to install it
- Use dev server URL
<rosetta MCP development server URL> - Test end-to-end through the HTTP MCP
- Uninstall
-
Open a PR.
- Follow the Pull Request Checklist
- Prompting: include a prompt brief, before/after examples, and validation evidence
- Coding: include tests and validation changes
- All: update documentation, including web site
-
Pipelines.
- Automated pipelines run on your PR: static AI review and scenario comparison (detailed in step 2 above)
- Both must pass before merge
rosetta/
├── instructions/ ← Prompts: skills, agents, workflows, rules, templates
│ ├── r2/ ← Previous release (supported; backports only)
│ └── r3/ ← Current release
│ ├── core/ ← Rosetta instruction source
│ └── <org>/ ← Optional organization extensions (e.g., acme/)
├── src/rosetta-mcp-server/ ← Rosetta MCP server (PyPI: rosetta-mcp)
│ ├── rosetta_mcp/ ← Server source code
│ ├── tests/ ← Unit tests (pytest)
│ └── validation/ ← verify_mcp.py integration test
├── src/rosetta-cli/ ← Rosetta CLI package (PyPI: rosetta-cli)
│ ├── rosetta_cli/ ← CLI source package
│ ├── pyproject.toml ← Package metadata + entrypoints
│ └── tests/ ← CLI unit tests
├── deployment/ ← Helm charts (RAGFlow)
├── plugins/ ← IDE plugin definitions
├── docs/ ← Deep documentation (Architecture, Context)
│ ├── mcp/ ← MCP-only deep reference (Authentication, RAGFlow, self-hosted Deployment Guide)
│ └── web/ ← Jekyll website (GitHub Pages)
└── refsrc/ ← Reference sources (read-only, resolves AI stale knowledge)
- Python 3.12+
- uvx (included with uv)
- Podman or Docker (optional, for Redis, used by full MCP execution_controller tests)
Use this when editing prompts (skills, agents, workflows, rules, templates).
Instructions run locally without MCP.
Copy them into a target repository and point your IDE using the local-files-mode.md bootstrap file.
Follow Offline Installation, except you copy your new instructions files:
cp -r instructions/ /path/to/target-repo/instructions/No server, no API key, no network. Edit instructions, reload, test.
Use this when changing MCP server code, tool prompts, or bundler logic.
Run MCP locally in STDIO mode against the dev RAGFlow instance.
Start a Redis-compatible container:
# Podman
podman run -d --name rosetta-redis -p 6379:6379 docker.io/valkey/valkey:latest
# Docker
docker run -d --name rosetta-redis -p 6379:6379 valkey/valkey:latestClaude Code:
claude mcp add --transport stdio Rosetta \
--env ROSETTA_SERVER_URL=https://<development server URL>/ \
--env ROSETTA_API_KEY=ragflow-xxxxx \
--env VERSION=r3 \
--env REDIS_URL=redis://localhost:6379/0 \
-- uvx --prerelease=allow rosetta-mcp@latestCodex:
codex mcp add Rosetta \
--env ROSETTA_SERVER_URL=https://<development server URL>/ \
--env ROSETTA_API_KEY=ragflow-xxxxx \
--env VERSION=r3 \
--env REDIS_URL=redis://localhost:6379/0 \
-- uvx --prerelease=allow rosetta-mcp@latestCursor (.cursor/mcp.json):
{
"mcpServers": {
"Rosetta": {
"command": "uvx",
"args": ["--prerelease=allow", "rosetta-mcp@latest"],
"env": {
"ROSETTA_SERVER_URL": "https://<development server URL>/",
"ROSETTA_API_KEY": "ragflow-xxxxx",
"VERSION": "r3",
"REDIS_URL": "redis://localhost:6379/0"
}
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"Rosetta": {
"type": "stdio",
"command": "uvx",
"args": ["--prerelease=allow", "rosetta-mcp@latest"],
"env": {
"ROSETTA_SERVER_URL": "https://<development server URL>/",
"ROSETTA_API_KEY": "ragflow-xxxxx",
"VERSION": "r3",
"REDIS_URL": "redis://localhost:6379/0"
}
}
}
}API key: Get yours from the RAGFlow UI. The dataset you test against must be owned by user of this API key.
VERSION: Set explicitly here for local development testing. Always test with VERSION=r3; also test VERSION=r2 when backporting.
Pre-release builds: Version suffixes like b00 trigger automatic pre-release publishing. Use --prerelease=allow with uvx to pull these builds.
Add the bootstrap rule to your IDE as defined in Quick Start — Add Bootstrap Rule.
Use this when changing publish, verify, or cleanup commands.
python3 -m venv venv
venv/bin/pip install -r requirements.txt
cp .env.dev .env # Points at dev RAGFlow instance
venv/bin/rosetta-cli verifyUse two stages when developing the CLI: first test your checkout from the repo virtualenv, then test the packaged CLI with uvx after push/merge.
Preview changes without publishing:
cd src/rosetta-cli
../../venv/bin/python -m rosetta_cli version
../../venv/bin/python -m rosetta_cli verify --env dev
../../venv/bin/python -m rosetta_cli publish ../../instructions --dry-run --env devAfter the package is published, test the packaged CLI with uvx:
uvx rosetta-cli@latest verify --env dev
uvx rosetta-cli@latest publish ../instructions --dry-run --env devThe --dry-run flag shows what would be published (new, changed, unchanged files) without writing anything to RAGFlow.
# From repo root, with the root venv activated
cp .env.dev .env && VERSION=r3 venv/bin/python src/rosetta-mcp-server/validation/verify_mcp.py
# With Redis (tests OAuth client/token storage — the dual-backend store path)
cp .env.dev .env && REDIS_URL="redis://localhost:6379/0" VERSION=r3 venv/bin/python src/rosetta-mcp-server/validation/verify_mcp.pyRun r3; also r2 when backporting. If your change touches Redis-dependent features, run with and without REDIS_URL.
# MCP server tests
venv/bin/pytest src/rosetta-mcp-server/tests
# CLI tests
venv/bin/pytest src/rosetta-cli/tests./src/validate-types.shRun this after any Python code change.
The repository ships a native Git pre-commit hook shim in .githooks/pre-commit.
It runs the Python entrypoint at scripts/pre_commit.py, which first regenerates all plugin payloads (via npx -y rosettify-plugins@latest) and then executes type validation.
Use the root repo virtualenv for hook execution:
python3 -m venv venv
venv/bin/pip install -r requirements.txt
git config core.hooksPath .githooksGit does not automatically use the repository's .githooks/ directory.
Each developer must run git config core.hooksPath .githooks once in their local clone to enable the native pre-commit hook.
On Windows, use the matching root-venv interpreter and pip executable:
py -3 -m venv venv
venv\Scripts\pip.exe install -r requirements.txt
git config core.hooksPath .githooksYou can test the hook entrypoint directly:
venv/bin/python scripts/pre_commit.pyAfter local validation passes, test end-to-end against the dev environment.
Environments (two separate servers):
- Rosetta Server (RAGFlow) prod:
https://<production server URL>/— document engine backend, dataset management, API keys - Rosetta Server (RAGFlow) dev:
https://<development server URL>/— used by STDIO MCP and CLI for publishing - Rosetta HTTP MCP prod:
<rosetta MCP production server URL>— production MCP endpoint for end users - Rosetta HTTP MCP dev:
<rosetta MCP development server URL>— dev MCP endpoint for integration testing
cp .env.dev .env
uvx rosetta-cli@latest publish instructionsThis publishes to the dev RAGFlow instance. Only changed files are uploaded (MD5-based change detection). Use --force to republish everything.
Connect your IDE using the STDIO configs from Local Development: MCP. This validates that your published instructions are served correctly through the MCP layer.
This is the mode end users run. Connect your IDE to the hosted dev MCP endpoint over HTTP.
Claude Code — the repo's .mcp.json already contains this config; no extra setup needed:
claude mcp add --transport http Rosetta <rosetta MCP development server URL>Codex:
codex mcp add Rosetta --url <rosetta MCP development server URL>Cursor (.cursor/mcp.json):
{
"mcpServers": {
"Rosetta": {
"url": "<rosetta MCP development server URL>"
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"Rosetta": {
"type": "http",
"url": "<rosetta MCP development server URL>"
}
}
}Authenticate via OAuth as required.
Add the bootstrap rule to your IDE as defined in Quick Start — Add Bootstrap Rule.
If you changed CLI commands, first test the checkout from source with the repo virtualenv:
cd src/rosetta-cli
../../venv/bin/python -m rosetta_cli publish ../../instructions --dry-run --env dev
../../venv/bin/python -m rosetta_cli publish ../../instructions --env dev
../../venv/bin/python -m rosetta_cli list-dataset --dataset aia-r3 --env devAfter push/merge and package publish, repeat the same checks through the published package:
uvx rosetta-cli@latest publish instructions --dry-run --env dev
uvx rosetta-cli@latest publish instructions --env dev
uvx rosetta-cli@latest list-dataset --dataset aia-r3 --env dev| Change type | Location | Validation |
|---|---|---|
| New/modified skill | instructions/r3/core/skills/<name>/SKILL.md |
Publish, test via MCP |
| New/modified agent | instructions/r3/core/agents/<name>.md |
Publish, test via MCP |
| New/modified workflow | instructions/r3/core/workflows/<name>.md |
Publish, test via MCP |
| New/modified rule | instructions/r3/core/rules/<name>.md |
Publish, test via MCP |
| Organization extension | instructions/r3/<org>/ (same type structure) |
Publish, test via MCP |
| MCP tool or prompt | src/rosetta-mcp-server/rosetta_mcp/server.py, tool_prompts.py |
verify_mcp.py, pytest, src/validate-types.sh |
| CLI command | src/rosetta-cli/rosetta_cli/commands/ |
pytest, dry-run, publish to dev |
| Website | docs/web/ |
Local Jekyll build |
| Documentation | docs/, repo root .md files |
Use AI to check consistency |
Always publish the entire /instructions folder. Never subfolders or single files (breaks tag extraction). See MCP Architecture — Rosetta CLI for details on auto-tagging and change detection.
The short version:
- README — orientation, what and why
- QUICKSTART — zero to working setup
- PLUGINS — install as a plugin (recommended)
- MCPs — install via MCP (optional, secondary)
- OVERVIEW — mental model, terminology
- CONTRIBUTING — PR workflow, checklist
- DEVELOPER_GUIDE (this doc) — repo navigation, local dev
- docs/CONTEXT — business context, target state (docs/MCP-CONTEXT for the self-hosted MCP business case)
- docs/ARCHITECTURE — system structure, components, data flow (docs/MCP-ARCHITECTURE for MCP server internals)
- REVIEW — what reviewers check
- USAGE_GUIDE — how to use Rosetta flows
- docs/mcp/DEPLOYMENT_GUIDE — self-hosted MCP: RAGFlow, MCP, Helm deployment (optional, secondary)
- TROUBLESHOOTING — symptom-first diagnosis
Manual recommended; AI-assisted possible but less reliable.
agents/instructions/
├── core/r1/
│ ├── workflow_name.md
│ ├── workflow_name-phase1.md
│ ├── workflow_name-phase2.md
│ └── ...
├── advanced/r1/
│ └── (same pattern)
└── common/r1/
└── (shared rules and utilities)
instructions/r3/
├── core/
│ ├── workflows/
│ │ ├── workflow-name-flow.md
│ │ ├── workflow-name-flow-phase1-name.md
│ │ └── workflow-name-flow-phase2-name.md
│ ├── skills/
│ │ └── skill-name/
│ │ └── SKILL.md
│ ├── agents/
│ ├── rules/
│ └── configure/
| R1 | R3 |
|---|---|
workflow_name.md |
workflow-name-flow.md |
workflow_name-phaseN.md |
workflow-name-flow-phase-name.md |
| (inline in workflow) | skill-name/SKILL.md (extracted) |
Key changes:
- Underscores replaced with dashes
- Workflow files get
-flowsuffix - Phase files include descriptive name instead of just a number
- Skills are extracted into their own folder with a
SKILL.mdentry point - Scope moved from
agents/instructions/{core,advanced,common}/r1/toinstructions/r3/core/
Manual recommended; AI-assisted possible but less reliable.
Add this frontmatter block at the top of each workflow file:
---
name: workflow-name-flow
description: "Rosetta workflow for [brief description of WHEN/HOW to use and WHAT it does]"
tags: ["relevant", "tags"]
baseSchema: docs/schemas/workflow.md
---Full schema reference: docs/schemas/workflow.md
Add this frontmatter block at the top of each phase file:
---
name: workflow-name-flow-phase-name
description: "Brief description of WHEN/HOW to use this phase and WHAT it does"
tags: ["relevant", "tags"]
baseSchema: docs/schemas/phase.md
---Full schema reference: docs/schemas/phase.md
Add this frontmatter block at the top of each SKILL.md:
---
name: skill-name
description: "Rosetta skill for [brief description of WHEN/WHY to use]"
tags: ["relevant", "tags"]
baseSchema: docs/schemas/skill.md
---Full schema reference: docs/schemas/skill.md
AI-assisted only; manual is not practical for this step.
Execute the following prompt to extract reusable skills from workflow phases:
MUST FULLY EXECUTE
instructions/r3/core/workflows/coding-agents-prompting-flow.mdto refactor skills out of full Rosetta workflow with phases[workflow_file]as R3 prompt family.
- Skills were identified and extracted for relevant phases
- Refactored files (
SKILL.md, phase files) were reviewed for correctness - Main sections use XML tags per schema (
<context>,<workflow_phases>, etc.)
AI-assisted recommended; manual also possible.
Replace markdown sections in workflow and phase files with XML tags (<context>, <critical_requirements>, <workflow_phases>, <validation_checklist>, <pitfalls>, etc.) as defined by the respective schema.
| File type | Schema | Example |
|---|---|---|
| Workflow | docs/schemas/workflow.md |
instructions/r3/core/workflows/coding-flow.md |
| Phase | docs/schemas/phase.md |
instructions/r3/core/workflows/testgen-flow-data-collection.md |
| Skill | docs/schemas/skill.md |
instructions/r3/core/skills/coding-agents-prompt-authoring/SKILL.md |
There's an example of the format
instructions/r3/core/workflows/coding-flow.md. There's a schema for workflowsdocs/schemas/workflow.md. Please use it for reformatting[workflow_file].
There's an example of the format
instructions/r3/core/workflows/testgen-flow-data-collection.md. There's a schema for phasesdocs/schemas/phase.md. Please use it for reformatting[phase_file].
There's a schema for skills
docs/schemas/skill.md. Please use it for reformatting[skill_file].
Manual only.
After each step, run the refactored flow end-to-end and verify that output matches the original intent.
Lessons learned from multiple transformation attempts:
- Missing subagent contracts — if a subagent is defined in a workflow/phase file, its input and output must be defined as well
- Unnecessary skill proliferation — double-check whether new skills are truly needed; reuse existing ones when possible
- Lost instructions — refactoring can inadvertently delete content (examples, edge cases); test the refactored flow after each step to confirm output still meets expectations
Upgrading a workspace from R2 to R3 requires no structural migration — the folder layout is unchanged. The differences are the consolidated bootstrap (one always-on rule plus one mode file) and the revised command vocabulary. For sweeping documentation to the R3 vocabulary, see PATTERNS/vocabulary-migration.md.
- Contributing — fastest path to a merged PR
- Architecture — system structure, components, data flow
- Quickstart — zero to working setup
- Overview — mental model, key concepts
- Review Standards — what reviewers verify
- Usage Guide — how to use Rosetta flows
- Deployment Guide — RAGFlow, MCP, Helm deployment
- Troubleshooting — symptom-first diagnosis