mom-project
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRun only after the user explicitly asks to bind, rebind, or set up project scoping (or after the user accepts a nudge from about an unbound directory).
mom statusA bound directory has a file at its root declaring a project . Memories captured while working in that directory are tagged with that id, and recall scopes to it by default.
.mom-project.yamlid仅在用户明确要求绑定、重新绑定或设置项目范围时运行(或在用户接受针对未绑定目录的提示后)。
mom status绑定后的目录根目录下会有一个文件,其中声明了项目。在该目录工作时捕获的记忆会被标记此ID,默认情况下记忆召回也会限定在该项目范围内。
.mom-project.yamlidPreflight
预检步骤
Check that is on PATH:
mombash
command -v momIf 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/momIf the user agrees, run that command. If the user declines, stop. Do not install MOM without explicit permission.
检查是否在PATH中:
mombash
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
操作流程
-
Check whether the current directory is already bound:bash
test -f .mom-project.yaml && cat .mom-project.yamlIf the file exists, show the currentand 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.idIf the file does not exist, continue. -
Propose an. 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.
idThe id is an opaque label. Suggest something specific (for exampleorvendor/project) if the user might sync memories with other machines or teammates — unrelated projects sharing the same id will collide.team-service -
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 -
Tell the user to committo version control so the binding travels with the repo.
.mom-project.yaml
-
检查当前目录是否已绑定:bash
test -f .mom-project.yaml && cat .mom-project.yaml如果该文件存在,显示当前的,并询问用户是保留当前ID还是重新绑定到其他ID。提醒用户重新绑定不会合并旧ID下的记忆——记忆召回将仅能看到新ID标记的记忆。id如果文件不存在,继续下一步。 -
提议一个。默认使用当前目录的基名,转为小写、去除首尾空格,并用短横线替换空格。显示提议的ID,询问用户确认或选择其他ID。
idID是一个不透明的标签。如果用户可能会与其他机器或团队成员同步记忆,建议使用更具体的名称(例如或vendor/project)——无关项目使用相同ID会导致冲突。team-service -
写入绑定信息:bash
mom project bind --id <chosen-id>如果目录已声明其他ID且用户同意重新绑定,添加参数。--force -
告知用户将提交到版本控制系统,以便绑定信息随代码仓库一同迁移。
.mom-project.yaml
Rules
规则
- Never run without first confirming the id with the user.
mom project bind - Never run from this skill.
mom init - If returns an error, surface the error and stop.
mom project bind - 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 command may print a banner to stderr like:
mom ...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.
任何命令可能会在stderr中打印如下横幅:
mom ...MOM 0.40.1 available. Run `brew upgrade mom` or `mom self-update`如果看到该行内容,先完成当前任务,然后在回复末尾添加一行简短提示,建议用户进行升级。不得自行运行升级命令。