roleme

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

roleMe

roleMe

/roleMe
无参调用时,应先列出现有角色供用户选择加载;如果用户不想加载已有角色,就先问他要创建的角色名,再进入初始化流程。
详细使用说明见
references/usage.md
命令面:
  • /roleMe
  • /roleMe <角色名>
  • /roleMe list
  • /roleMe optimize [角色名]
  • /roleMe export [角色名]
  • /roleMe doctor [角色名]
运行时原则:
  • roleMe
    管理的是用户角色上下文,不是助手人格切换。
  • 角色包默认保存在
    ~/.roleMe/<角色名>/
    ;不要去
    ~/.agents/skills/roleme/roles/
    之类的 skill 安装目录猜路径。
  • 需要列出现有角色或判断角色是否存在时,应以
    tools/role_ops.py
    list_roles()
    role_dir()
    语义为准,不要手写 shell 路径探测。
  • 未被结构化写入角色包的上下文,不应假定模型已经知道;稳定信息应落到
    persona/
    memory/
    brain/
    projects/
    中可检索的位置。
  • 常驻层与渐进层的边界由角色包内的
    AGENT.md
    决定。
  • 常驻层应保持最小且稳定;细节、专题知识与项目上下文优先按需展开,而不是堆进单个总说明。
  • 记忆写回优先遵循
    AGENT.md
    中的策略和
    memory/
    结构。
  • 主题知识与项目上下文通过
    tools/context_router.py
    做渐进式发现,不应一次性全量加载。
  • 用户不需要直接维护 Graph;Context Graph 是后台机制,不改变用户正常对话方式。
  • 归档内容优先追求对智能体可读:结构清晰、边界明确、可检索、可增量更新,而不是只写成长段自由叙述。
  • 初始化访谈可以是动态的:问题由模型根据当前已知信息和信息缺口来决定,但最终仍要落到稳定的
    persona/
    memory/
    brain/
    projects/
    结构。
  • 槽位只是归档目标,不是固定提问顺序;模型应按当前情景决定下一问,而不是机械执行问卷。
  • 初始化访谈应更像采访而不是填表:用户没有表达出来的信息可以先不记录,不要为了补全而反复追问同一槽位。
  • 槽位提示只是采访锚点,不是最终逐字发问文案;真正问用户前,应结合当前上下文先润色成自然口语。
  • 当用户第一次无参执行
    /roleMe
    时,应先列出现有角色,让用户选择加载;如果用户选择创建新角色,应先询问角色名,再开始采访。
  • 语言偏好应在初始化时显式采访一次;如果用户暂时没有给出明确偏好,可以留空并在后续使用中慢慢积累。
  • 初始化成功后,应明确提醒用户重新调用
    /roleMe <角色名>
    ,以便把新写入的角色包加载进后续会话使用的快照。
  • 当角色已加载后,如果用户说“帮我总结这个项目的工作方式”或“帮我总结成通用的工作方式”,应直接把结果归档到当前角色,而不是只返回普通总结文本。
  • 当角色已加载后,若用户内容明显属于学习沉淀、项目复盘、方法论提炼、稳定偏好或长期协作规则,助手应主动进行归档,而不必等待用户显式下达“归档”指令。
  • 归档前应先提炼原始内容,再判断归档位置,而不是把原始对话直接整段落盘。
  • 默认先写入,再用一句短回执告知用户归档结果。
  • 判断不够确定时,优先写入
    memory/episodes/
    或项目记忆,不轻易提升到
    memory/USER.md
    memory/MEMORY.md
  • 项目级 workflow 写入
    projects/<project-slug>/workflows/index.md
    projects/<project-slug>/workflows/<workflow-slug>.md
    ;通用 workflow 写入
    brain/workflows/index.md
    brain/workflows/<workflow-slug>.md
    context.md
    brain/index.md
    只保留到工作流索引的入口,一个 workflow,一个文件,并将稳定规则提升到
    memory/USER.md
    memory/MEMORY.md
  • 角色加载生成的冻结快照除常驻文件外,还应优先携带“当前项目 workflow 摘要”和“通用 workflow 摘要”;摘要来自各自的 workflow index,而不是 workflow 正文。
  • 当前角色由当前会话已加载的角色决定,自然语言归档必须写入该会话角色;
    .current-role.json
    不再作为当前角色来源。
  • 如果用户输入
    /roleMe current
    ,应返回固定提示:
    /roleMe current 已不再支持全局当前角色查询。请在当前会话重新执行 /roleMe <角色名>。
  • 如果归档提升了 resident 规则或摘要,应提醒用户重新执行
    /roleMe <角色名>
    才会刷新当前会话底座。
  • optimize
    doctor
    应优先发现和修复角色包的熵增问题,例如重复记忆、索引失效、resident/on-demand 边界漂移。
  • 只有确定性的文件操作才调用
    tools/role_ops.py
    tools/memory.py
    tools/context_router.py
  • 打包产物中不包含开发仓库的
    scripts/
When
/roleMe
is called without parameters, first list existing roles for the user to choose and load; if the user does not want to load an existing role, first ask for the name of the role to be created, then proceed to the initialization process.
For detailed usage instructions, see
references/usage.md
.
Command interface:
  • /roleMe
  • /roleMe <role name>
  • /roleMe list
  • /roleMe optimize [role name]
  • /roleMe export [role name]
  • /roleMe doctor [role name]
Runtime principles:
  • roleMe
    manages user role contexts, not assistant personality switching.
  • Role bundles are stored by default in
    ~/.roleMe/<role name>/
    ; do not guess paths in skill installation directories like
    ~/.agents/skills/roleme/roles/
    .
  • When needing to list existing roles or check if a role exists, follow the semantics of
    list_roles()
    and
    role_dir()
    in
    tools/role_ops.py
    ; do not manually write shell path detection.
  • Context not structurally written into the role bundle should not be assumed to be known by the model; stable information should be stored in retrievable locations within
    persona/
    ,
    memory/
    ,
    brain/
    , and
    projects/
    .
  • The boundary between the resident layer and the on-demand layer is determined by
    AGENT.md
    within the role bundle.
  • The resident layer should remain minimal and stable; details, thematic knowledge, and project context should be expanded on demand first, rather than being piled into a single overall description.
  • Memory write-back should prioritize following the strategy in
    AGENT.md
    and the
    memory/
    structure.
  • Thematic knowledge and project context are discovered progressively via
    tools/context_router.py
    ; full loading at once is not allowed.
  • Users do not need to directly maintain the Graph; Context Graph is a background mechanism that does not change the user's normal conversation method.
  • Archived content should prioritize readability for agents: clear structure, clear boundaries, retrievable, incrementally updatable, rather than just being written as long free narratives.
  • The initialization interview can be dynamic: questions are determined by the model based on currently known information and information gaps, but must ultimately be structured into stable
    persona/
    ,
    memory/
    ,
    brain/
    , and
    projects/
    .
  • Slots are only archiving targets, not fixed question sequences; the model should determine the next question based on the current scenario, rather than mechanically executing a questionnaire.
  • The initialization interview should be more like an interview than filling out a form: information not expressed by the user can be left unrecorded first; do not repeatedly ask about the same slot just to complete it.
  • Slot prompts are only interview anchors, not the final verbatim questions; before actually asking the user, the prompt should be polished into natural spoken language combined with the current context.
  • When the user executes
    /roleMe
    without parameters for the first time, first list existing roles for the user to choose and load; if the user chooses to create a new role, first ask for the role name, then start the interview.
  • Language preferences should be explicitly asked once during initialization; if the user does not give a clear preference temporarily, it can be left blank and accumulated gradually during subsequent use.
  • After successful initialization, clearly remind the user to call
    /roleMe <role name>
    again to load the newly written role bundle into the snapshot used for subsequent conversations.
  • When a role is already loaded, if the user says "Help me summarize the working method of this project" or "Help me summarize it into a general working method", directly archive the result into the current role instead of just returning a normal summary text.
  • When a role is already loaded, if the user's content clearly belongs to learning accumulation, project review, methodology refinement, stable preferences, or long-term collaboration rules, the assistant should actively archive it without waiting for the user to explicitly issue an "archive" instruction.
  • Before archiving, first refine the original content, then determine the archiving location, rather than directly archiving the entire original conversation paragraph.
  • By default, write first, then inform the user of the archiving result with a short receipt.
  • When unsure, prioritize writing to
    memory/episodes/
    or project memory; do not easily promote to
    memory/USER.md
    and
    memory/MEMORY.md
    .
  • Project-level workflows are written to
    projects/<project-slug>/workflows/index.md
    and
    projects/<project-slug>/workflows/<workflow-slug>.md
    ; general workflows are written to
    brain/workflows/index.md
    and
    brain/workflows/<workflow-slug>.md
    ;
    context.md
    and
    brain/index.md
    only keep the entry to the workflow index, one file per workflow, and promote stable rules to
    memory/USER.md
    and
    memory/MEMORY.md
    .
  • The frozen snapshot generated by role loading should, in addition to resident files, prioritize carrying the "current project workflow summary" and "general workflow summary"; summaries come from their respective workflow indexes, not the workflow body.
  • The current role is determined by the role loaded in the current session; natural language archiving must be written to this session's role;
    .current-role.json
    is no longer used as the source of the current role.
  • If the user inputs
    /roleMe current
    , return the fixed prompt:
    /roleMe current no longer supports global current role queries. Please re-execute /roleMe <role name> in the current session.
  • If archiving promotes resident rules or summaries, remind the user to re-execute
    /roleMe <role name>
    to refresh the current session base.
  • optimize
    and
    doctor
    should prioritize discovering and fixing entropy increase issues in role bundles, such as duplicate memories, invalid indexes, and boundary drift between resident/on-demand layers.
  • Only deterministic file operations should call
    tools/role_ops.py
    ,
    tools/memory.py
    , and
    tools/context_router.py
    .
  • The packaged product does not include the
    scripts/
    directory of the development repository.