一键导入
sync-tutorial-to-e2e-tests
// Match tutorial script blocks to e2e pytest functions and add missing tests
// Match tutorial script blocks to e2e pytest functions and add missing tests
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 FCT template).
Create a new PRIVATE GitHub repo that is a full-history copy of imbue-ai/forever-claude-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 forever-claude clone", "fork the forever-claude template as a private repo", "make me a new private copy of forever-claude-template", or similar.
Cut a new "production" release of the minds app. Pushes a release branch in the mngr clone at ~/project/minds_prod, syncs vendor/mngr in ~/project/forever-claude-template to match, pushes the same-named branch there, and merges the release branch into FCT main. Use when the user asks to "release a new version of minds", "cut a minds release", "update the vendored mngr in forever-claude-template to track <branch>", or anything of that shape.
Resolve an agent name or description to an exact mngr agent name. Used by other skills that target agents.
Send a message to another mngr agent. Use when you need to communicate with a peer agent.
Wait for another agent to enter WAITING state, then execute follow-up instructions
| 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
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:
write_tutorial_block() calls (the block must appear verbatim in the call argument)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 write_tutorial_block() call 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 write_tutorial_block() argument to exactly reproduce the current script block, and update the test logic to match the new behavior. 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.
The priority is coverage, not perfection -- a separate step will improve test quality later. What matters is that each tutorial block has a corresponding test function with the correct write_tutorial_block() call and at least a basic assertion.
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).
Each function MUST call e2e.write_tutorial_block("""...""") as its first statement, with the exact text of the script block (the matcher checks this). The block text will be dedented and stripped automatically, so indent it naturally with the surrounding Python code. Example:
@pytest.mark.release
def test_foo(e2e: E2eSession, agent_name: str) -> None:
e2e.write_tutorial_block("""
# comment from tutorial
mngr create my-task --some-flag
# another comment
""")
result = e2e.run("mngr create my-task --some-flag")
assert result.exit_code == 0
Other requirements:
@pytest.mark.releasee2e: E2eSession as the fixture type--help)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.