一键导入
sync-tutorial-to-e2e-tests
Match tutorial script blocks to e2e pytest functions and add missing tests
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Match tutorial script blocks to e2e pytest functions and add missing tests
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Address review comments on a pull request -- apply CLAUDE:/SCULPTOR:-prefixed instructions, and critically evaluate feedback from automated reviewers (Vet, Copilot, or any bot)
Prune code comments down to what helps future maintainers. Reviews comments on the current branch's diff and removes incidental history, defensive justification, and correctness arguments. Invoke with /crispy-comments.
End-to-end dev workflow for the minds app stack -- first-time bring-up, every-startup vendor/mngr sync, and the iteration loop against a running Docker agent. Use this when starting or restarting the dev Electron app, or after changing any minds component (mngr, the system interface, the default workspace template).
Create a new PRIVATE GitHub repo that is a full-history copy of imbue-ai/default-workspace-template's current main branch, clone it to <parent-dir>/<repo-name> (default $HOME/project), and push. Use when the user asks to "spin up a new default-workspace-template clone", "fork the default-workspace-template as a private repo", "make me a new private copy of default-workspace-template", or similar.
Use the root justfile as the canonical entry point for ANY minds task -- minds app (desktop client), pool hosts, minds environments (activate/deploy/destroy), minds deployments, and minds tests. Before running ad-hoc `uv run minds ...` / `mngr imbue_cloud ...` commands, check the justfile for a named recipe; if none exists for the task, ADD one. Use whenever the request involves the minds app, pool/leased hosts, a minds env/tier (dev/staging/production), or a minds deploy.
Cut a new production release of the minds app (version bump, FALLBACK_BRANCH, vendor/mngr sync, and minds-v<version> tags on both mngr and default-workspace-template, proven green on CI). The full procedure lives in apps/minds/docs/release.md in the mngr checkout; this skill defers to it. Use when the user asks to "release a new version of minds", "cut a minds release", "bump the minds version", "update the vendored mngr in default-workspace-template", or anything of that shape.
| 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.