用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/imbue-ai/default-workspace-template --skill sync-tutorial-to-e2e-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | sync-tutorial-to-e2e-tests |
| argument-hint | <script_file> <test_directory> |
| description | Match tutorial script blocks to e2e pytest functions and add missing tests |
Default arguments (if none provided): libs/mngr/imbue/mngr/resources/mega_tutorial.sh libs/mngr/imbue/mngr/e2e/tutorial
Your task is to ensure that every command block in a tutorial shell script has a corresponding pytest function.
Run the tutorial matcher script to find unmatched blocks and functions:
uv run python scripts/tutorial_matcher.py $ARGUMENTS
If the output says everything is matched, you are done.
Read the tutorial script file and the test directory to understand the overall structure and conventions used in the existing tests.
Pay close attention to:
Tutorial block: section followed by a Scope: section. The matcher reads the block from the Tutorial block: section.Each tutorial test's docstring is strictly the verbatim tutorial block plus its scope -- no leading summary line:
@pytest.mark.release
def test_foo(e2e: E2eSession, agent_name: str) -> None:
"""Tutorial block:
# comment from tutorial
mngr create my-task --some-flag
# another comment
Scope: <crystallized scope -- see step 4>.
"""
result = e2e.run("mngr create my-task --some-flag")
assert result.exit_code == 0
Tutorial block: section holds the script block verbatim (the matcher checks this). It is dedented naturally with the surrounding Python; indent the block lines under the header.Scope: section is the crystallized scope you author in step 4.Handle these FIRST, before adding new tests, because some of these may pair up with unmatched script blocks.
For each pytest function that doesn't correspond to any script block, compare its docstring's Tutorial block: section against the list of unmatched script blocks. If there is a script block that mostly matches (e.g., a command was renamed, a flag was added, or a line was changed), the script block was likely modified after the test was written. In that case, update the Tutorial block: section to exactly reproduce the current script block, update the test logic to match the new behavior, and update the Scope: accordingly. This also resolves that script block, so it no longer needs a new test in step 4.
If no script block is even a close match, the block was removed from the script entirely. Remove the test function.
After step 3, some script blocks may still lack tests. Add tests to the appropriate existing test file, or create a new file if the blocks belong to a distinct section (e.g., test_create_remote.py for "CREATING AGENTS REMOTELY" blocks).
Tutorial block: section, then the Scope: section.@pytest.mark.release.e2e: E2eSession as the fixture type.--help).The Scope: is the contract TMR enforces: it states exactly what the test must verify, so TMR never has to re-derive it from the commands. The tutorial block is the lower bound on scope. Crystallize the implicit requirements of the block's commands into the Scope: prose, and write assertions that match it:
mngr foo must do something observable -- a real-world side effect or something in its output. State the effect, and assert it the way a human would when debugging (files, git status, command output). Golden rule: the assertion should pass for this command, but FAIL if the command were not run or were replaced by a no-op. E.g. if the block creates an agent in a directory, the scope says to verify it is running there (mngr exec $agent pwd), not merely that the command exited 0.mngr foo --bar=lorem must do something different from the same command without --bar=lorem. State and verify that difference.Keep the scope tight: enough to prove the documented behavior, no gold-plating.
Re-run the matcher to confirm everything is matched:
uv run python scripts/tutorial_matcher.py $ARGUMENTS
Do NOT run the tests locally -- these are e2e tests and may be too expensive to run locally. They will be validated in CI.