global-projects
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGlobal Projects
全局项目
Use this skill to follow the user's project organization standard. The project CLI is installed as either (try first) or ; the skill is mainly about the directory standard and when to use the selected command. The document will use as an example.
moimomoStandard layout:
text
<rootPath>/<github-owner-or-org>/<repo>Examples:
text
~/code/vuejs/core
~/code/vitejs/vite
~/code/liangmiQwQ/mo使用此 skill 遵循用户的项目组织规范。项目 CLI 已安装为 (优先尝试)或 ;此 skill 主要介绍目录规范以及何时使用所选命令。文档将以 为例。
moimomo标准布局:
text
<rootPath>/<github-owner-or-org>/<repo>示例:
text
~/code/vuejs/core
~/code/vitejs/vite
~/code/liangmiQwQ/moFirst Step
第一步
Skill loading does not automatically execute commands. When a task needs the project root, select the CLI and run its paired resolver first:
bash
if command -v moi-get-root >/dev/null 2>&1; then
moi-get-root
elif command -v mo-get-root >/dev/null 2>&1; then
mo-get-root
else
echo "Install @liangmi/moi or @liangmi/mo before resolving global projects." >&2
exit 1
fiPrefer when both resolver commands exist. The resolver only reads and prints JSON with . If is missing, ask the user before creating or cloning anything; they may need to run or for the selected CLI.
moi~/.config/morc.jsonrootPathrootPathmoi setupmo setupUse the command paired with the resolver for the rest of the task: selects , while selects . Never identify the project CLI from the command alone because another tool may own that name. The examples below use ; substitute when was selected.
moi-get-rootmoimo-get-rootmomomomoimoi-get-root加载 skill 不会自动执行命令。当任务需要项目根目录时,先选择 CLI 并运行与之配对的解析器:
bash
if command -v moi-get-root >/dev/null 2>&1; then
moi-get-root
elif command -v mo-get-root >/dev/null 2>&1; then
mo-get-root
else
echo "Install @liangmi/moi or @liangmi/mo before resolving global projects." >&2
exit 1
fi当两个解析器命令都存在时,优先使用 。解析器仅读取 并输出包含 的 JSON。如果缺少 ,请先询问用户,再创建或克隆任何内容;用户可能需要为所选 CLI 运行 或 。
moi~/.config/morc.jsonrootPathrootPathmoi setupmo setup在任务后续部分,使用与解析器配对的命令: 对应 , 对应 。不要仅凭 命令判断项目 CLI,因为其他工具也可能使用该名称。下面的示例使用 ;如果选择了 ,则替换为 。
moi-get-rootmoimo-get-rootmomomomoi-get-rootmoiProject Path Rules
项目路径规则
After resolving , infer paths yourself.
rootPathFor a GitHub repo identifier, join the pieces directly:
text
owner/repo -> <rootPath>/owner/repoFor a GitHub URL:
text
https://github.com/vitejs/vite -> <rootPath>/vitejs/vite
git@github.com:vuejs/core.git -> <rootPath>/vuejs/coreFor a bare project name or fuzzy query:
- Run the selected CLI's command or inspect one level under
list.rootPath - Prefer exact repo-name matches.
- Prefer exact matches when the user gave an owner.
owner/repo - If multiple owners match, ask the user to choose.
- Use the resolved path directly for file operations.
Pay attention, the codebase may be not up to dated or even not in the main branch so please take care and use tricks to check.
解析 后,自行推断路径。
rootPath对于 GitHub 仓库标识符,直接连接各部分:
text
owner/repo -> <rootPath>/owner/repo对于 GitHub URL:
text
https://github.com/vitejs/vite -> <rootPath>/vitejs/vite
git@github.com:vuejs/core.git -> <rootPath>/vuejs/core对于仅提供项目名称或使用模糊查询的情况:
- 运行所选 CLI 的 命令,或检查
list下一层的内容。rootPath - 优先选择仓库名称完全匹配的项目。
- 如果用户提供了 owner,优先选择 完全匹配的项目。
owner/repo - 如果有多个 owner 匹配,请让用户选择。
- 直接使用解析出的路径进行文件操作。
请注意,代码库可能不是最新版本,甚至可能不在主分支上,因此请谨慎处理,并使用相应技巧进行检查。
Project CLI Command Usage
项目 CLI 命令用法
Use the selected project CLI when you need to clone/fork/create a project. Once you know the local path, use normal shell and editor tooling for ordinary file reads, edits, builds, and tests.
Use to discover existing managed repositories:
mo listbash
mo listUse when the user wants a GitHub project locally and it is not already under . This preserves the owner/repo layout:
mo clone <owner>/<repo><rootPath>/<owner>/<repo>bash
mo clone vitejs/viteUse to make a local project initialized using git and create a GitHub repo, only when the user explicitly asks to create/init a project:
mo initbash
mo init [options]当需要克隆、fork 或创建项目时,使用所选的项目 CLI。确定本地路径后,对于常规文件读取、编辑、构建和测试,使用普通的 shell 与编辑器工具。
使用 查找已有的受管理仓库:
mo listbash
mo list当用户希望在本地获取某个 GitHub 项目,且该项目尚不在 下时,使用 。这会保留 owner/repo 布局:
<rootPath>/<owner>/<repo>mo clone <owner>/<repo>bash
mo clone vitejs/vite仅当用户明确要求创建或初始化项目时,使用 通过 git 初始化本地项目并创建 GitHub 仓库:
mo initbash
mo init [options]Options, at least one of them should be provided if you
Options, at least one of them should be provided if you
--public Create as public repository
--public Create as public repository
--private Create as private repository
--private Create as private repository
`mo init` can change remote GitHub state. Treat it as a dangerous command.
Use `mo fork` only when the user explicitly asks to fork or create a fork:
```bash
mo fork vitejs/vite
mo fork vitejs/vite --org my-org
mo fork vitejs/vite --name my-viteForking also changes remote GitHub state. Treat it as a dangerous command. Do not fork for inspection, editing, testing, cloning, opening, or convenience. It also includes some prompts you need to answer.
`mo init` 可能会更改远程 GitHub 状态,应将其视为危险命令。
仅当用户明确要求 fork 或创建 fork 时,使用 `mo fork`:
```bash
mo fork vitejs/vite
mo fork vitejs/vite --org my-org
mo fork vitejs/vite --name my-viteFork 同样会更改远程 GitHub 状态,应将其视为危险命令。不要为了检查、编辑、测试、克隆、打开项目或图方便而执行 fork。该命令还包含一些需要回答的提示。
Working Standard
工作规范
- Search under before broad filesystem scans.
rootPath - Preserve the organization when cloning projects.
<owner>/<repo> - Avoid creating project directories outside unless the user asks.
rootPath - Name both owner and repo in status updates for cross-project work.
- Use the selected project CLI for repository discovery and placement; use normal shell and editor tooling once the local path is known.
- 在 下搜索,避免对整个文件系统进行广泛扫描。
rootPath - 克隆项目时保留 组织结构。
<owner>/<repo> - 除非用户另有要求,否则避免在 之外创建项目目录。
rootPath - 进行跨项目工作时,在状态更新中同时注明 owner 和 repo。
- 使用所选项目 CLI 发现和安置仓库;确定本地路径后,使用普通的 shell 与编辑器工具。