Overview
RoleX is an open-source framework from Deepractice that gives AI agents persistent identity, goals, plans, and tasks. Unlike static system prompts, every aspect of a role—identity, knowledge, experience, goals, plans, and tasks—is expressed as a Gherkin .feature file that can be version-controlled and read by humans. The project evolves the earlier PromptX system from Markdown .role.md files to structured BDD-style specifications.
Key points
- Persistent identity over static prompts. Traditional prompts and PromptX V1 describe a persona at the start of a session. RoleX lets a role remember who it is, what it is doing, and what it has learned across sessions. Identity, knowledge, and experience each live in their own
.identity.featurefiles under.rolex/<role>/identity/. - Five role dimensions expressed in Gherkin. Persona, knowledge, experience, goals, plans, and tasks each map to a file naming convention:
{name}.identity.feature,{name}.goal.feature,{name}.plan.feature,{name}.task.feature. - Three-tier society model. A
society(RoleX) creates roles and founds organizations via the Nüwa creator role. Anorganizationhires and fires roles. Individualrolesautonomously set goals viawant, build plans viaplan, track tasks viatodo, finish them withfinish, and synthesize experience withsynthesize. - MCP server with 15 tools. The
@rolexjs/mcp-serverpackage exposessociety.born,society.found,society.directory,society.find,society.teach,organization.hire,organization.fire, plus role-level toolsidentity,focus,want,plan,todo,achieve,abandon,finish, andsynthesize. - Quick start via MCP clients. Run
npx -y @rolexjs/mcp-serverfrom Claude Desktop (mcpServers), Claude Code (claude mcp add rolex -- npx -y @rolexjs/mcp-server), Cursor (.cursor/mcp.json), or VS Code (.vscode/mcp.json). Activation is a single message: "Activate Nüwa." - End-to-end example: Alex the backend engineer. The walkthrough creates Alex, writes
persona.identity.featuredescribing a Node.js/TypeScript engineer who practices test-first development, sets a goal of building a JWT auth system, drafts a three-phase plan (schema, API, security), implements individualregister.task.featurescenarios, and ends with structured lessons learned (e.g., rotating refresh tokens, bcrypt work factor of 12, encryption at the application layer). - Role-Driven Development (RDD). Positioned alongside TDD, BDD, and DDD, RDD treats roles as interfaces, goals as contracts (with
Thenclauses as success criteria), experience as compounding assets, and evolution as the default state. RDD fits long-running projects, multi-role team coordination, knowledge transfer between roles, and continuous iteration. - Migration from PromptX V1. PromptX roles flow through a "Dayu" migration expert into RoleX identity and knowledge files, after which Nüwa activation enables goal-driven work.
- Roadmap. Near-term: stabilized API, more sample roles, visualization. Mid-term: inter-role collaboration protocols, automatic experience synthesis, cloud sync. Long-term: a role marketplace, organization templates, and an AGI-ready identity system.
- GitHub: https://github.com/Deepractice/RoleX
- npm: https://www.npmjs.com/package/rolexjs
- Gherkin reference: https://cucumber.io/docs/gherkin/
- PromptX (predecessor): https://github.com/Deepractice/PromptX