mom-project

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Run only after the user explicitly asks to bind, rebind, or set up project scoping (or after the user accepts a nudge from
mom status
about an unbound directory).
A bound directory has a
.mom-project.yaml
file at its root declaring a project
id
. Memories captured while working in that directory are tagged with that id, and recall scopes to it by default.
仅在用户明确要求绑定、重新绑定或设置项目范围时运行(或在用户接受
mom status
针对未绑定目录的提示后)。
绑定后的目录根目录下会有一个
.mom-project.yaml
文件,其中声明了项目
id
。在该目录工作时捕获的记忆会被标记此ID,默认情况下记忆召回也会限定在该项目范围内。

Preflight

预检步骤

Check that
mom
is on PATH:
bash
command -v mom
If it is missing, tell the user MOM is not installed and ask permission to install it:
text
MOM is not installed. Install it now with Homebrew?
  brew install momhq/tap/mom
Source: https://github.com/momhq/mom
If the user agrees, run that command. If the user declines, stop. Do not install MOM without explicit permission.
检查
mom
是否在PATH中:
bash
command -v mom
如果未找到,告知用户MOM尚未安装,并询问是否允许安装:
text
MOM is not installed. Install it now with Homebrew?
  brew install momhq/tap/mom
Source: https://github.com/momhq/mom
如果用户同意,运行该命令。如果用户拒绝,停止操作。未经明确许可,不得安装MOM。

Flow

操作流程

  1. Check whether the current directory is already bound:
    bash
    test -f .mom-project.yaml && cat .mom-project.yaml
    If the file exists, show the current
    id
    and ask the user to either keep it or rebind to a different one. Warn that rebinding does not merge memories from the old id — recall will only see memories tagged with the new id.
    If the file does not exist, continue.
  2. Propose an
    id
    . Default to the current directory's basename, lowercased, trimmed, with spaces replaced by dashes. Show the proposal and ask the user to confirm or pick a different one.
    The id is an opaque label. Suggest something specific (for example
    vendor/project
    or
    team-service
    ) if the user might sync memories with other machines or teammates — unrelated projects sharing the same id will collide.
  3. Write the binding:
    bash
    mom project bind --id <chosen-id>
    If the directory already declares a different id and the user agreed to rebind, append
    --force
    .
  4. Tell the user to commit
    .mom-project.yaml
    to version control so the binding travels with the repo.
  1. 检查当前目录是否已绑定:
    bash
    test -f .mom-project.yaml && cat .mom-project.yaml
    如果该文件存在,显示当前的
    id
    ,并询问用户是保留当前ID还是重新绑定到其他ID。提醒用户重新绑定不会合并旧ID下的记忆——记忆召回将仅能看到新ID标记的记忆。
    如果文件不存在,继续下一步。
  2. 提议一个
    id
    。默认使用当前目录的基名,转为小写、去除首尾空格,并用短横线替换空格。显示提议的ID,询问用户确认或选择其他ID。
    ID是一个不透明的标签。如果用户可能会与其他机器或团队成员同步记忆,建议使用更具体的名称(例如
    vendor/project
    team-service
    )——无关项目使用相同ID会导致冲突。
  3. 写入绑定信息:
    bash
    mom project bind --id <chosen-id>
    如果目录已声明其他ID且用户同意重新绑定,添加
    --force
    参数。
  4. 告知用户将
    .mom-project.yaml
    提交到版本控制系统,以便绑定信息随代码仓库一同迁移。

Rules

规则

  • Never run
    mom project bind
    without first confirming the id with the user.
  • Never run
    mom init
    from this skill.
  • If
    mom project bind
    returns an error, surface the error and stop.
  • After a successful bind, confirm in one line that the directory is now bound to
    <id>
    .
  • 未经用户确认ID,不得运行
    mom project bind
    命令。
  • 不得从此技能中运行
    mom init
    命令。
  • 如果
    mom project bind
    返回错误,显示错误信息并停止操作。
  • 绑定成功后,用一行内容确认目录已绑定到
    <id>

Postflight (version hint)

后续步骤(版本提示)

Any
mom ...
command may print a banner to stderr like:
MOM 0.40.1 available. Run `brew upgrade mom` or `mom self-update`
If you see that line, finish the task first, then add one short line at the end of your reply suggesting the upgrade. Do not run the upgrade yourself.
任何
mom ...
命令可能会在stderr中打印如下横幅:
MOM 0.40.1 available. Run `brew upgrade mom` or `mom self-update`
如果看到该行内容,先完成当前任务,然后在回复末尾添加一行简短提示,建议用户进行升级。不得自行运行升级命令。