一键导入
e2e-testing-nori-skillsets-subcommands
Use when you need to interactively test a nori-skillsets CLI subcommand end-to-end via tmux, with full filesystem isolation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when you need to interactively test a nori-skillsets CLI subcommand end-to-end via tmux, with full filesystem isolation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user asks about anything related to nori.
Use when automating or testing TUI/CLI applications - provides isolated tmux sessions with scripts for input, output capture, and state verification
| name | E2E Testing Nori Skillsets Subcommands |
| description | Use when you need to interactively test a nori-skillsets CLI subcommand end-to-end via tmux, with full filesystem isolation |
e2e-setup to build the project and create the isolated environmentsource {{skills_dir}}/e2e-testing-skillsets/e2e-setup
The script prints the variables it exports. Verify E2E_DIR, SKS, and NORI_GLOBAL_CONFIG are set.
Read {{skills_dir}}/tui-puppeteering-with-tmux/SKILL.md
Follow its instructions exactly. All tmux interaction goes through its scripts.
Before touching tmux, write out a concrete plan:
$E2E_DIR before launching the commandtui-start command you will use (must include the env wrapper shown below)$E2E_DIRMany commands need pre-existing state. Create it directly in the filesystem:
# Example: create a fake skillset for switch/fork/edit to find
mkdir -p "$E2E_DIR/.nori/profiles/my-test-skillset"
echo '{"name":"my-test-skillset","version":"1.0.0","type":"skillset"}' > "$E2E_DIR/.nori/profiles/my-test-skillset/nori.json"
Launch the command inside tmux with isolation env vars:
SCRIPTS="{{skills_dir}}/tui-puppeteering-with-tmux"
SESSION="sks-e2e-$$"
$SCRIPTS/tui-start "$SESSION" "env NORI_GLOBAL_CONFIG=$E2E_DIR node $SKS <subcommand> [args]"
Then follow the assert-act-assert loop from the TUI Puppeteering skill.
After the command completes, check that the expected files were created/modified/deleted inside $E2E_DIR. Also verify that your real home directory was NOT touched.
$SCRIPTS/tui-stop "$SESSION"
{{skills_dir}}/e2e-testing-skillsets/e2e-teardown
Always stop tmux first, then tear down the filesystem.
NORI_GLOBAL_CONFIG=$E2E_DIR. This env var redirects every path that getHomeDir() resolves: ~/.nori/, ~/.nori-config.json, ~/.claude/, and anything else rooted at $HOME. Without it, the CLI writes to the real home directory.env NORI_GLOBAL_CONFIG=$E2E_DIR node $SKS ... as the command passed to tui-start. Never run bare nori-skillsets or sks.npm link. The built CLI is executed directly via node./tmp/nori/skillsets-e2e-scenario/. The e2e-setup script wipes and recreates it on every run.~/.nori/ and ~/.claude/ were not modified. The e2e-teardown script does this automatically.These are the authoritative conventions for nori-skillsets interactive subcommands. Use them to decide what to assert in your test plan.
exitOnFailure). Others display the error inline (via log.error) and show a normal outro. Check the specific command's behavior.y or n.note(content, title)) are used for multi-line structured information: change summaries, next steps, account details, artifact listings, diffs, warnings.log.error() for that.log.error() and the hint is shown in a separate note titled "Hint".\x1b[1m...\x1b[22m) is used in success outro messages to highlight the most important dynamic value: a skillset name, an email address, a package@version. Only one or two values per outro are bolded.green and red ANSI colors are used for diff content (added/removed lines). bold may highlight key values.tui-capture -e which preserves escape codes.Created new skillset "my-skillset").These commands present interactive prompts and are the primary targets for e2e testing:
new — collects name, optional description/license/keywords/version/repository via group promptfork <base> <new> — no prompts, but shows notes and has error pathsswitch [name] — select menu if no name given, change detection with save/abort/view-diff options, confirm promptinit — persistence warning confirm, optional existing config capture with text promptfactory-reset <agent> — artifact listing note, "confirm" text prompt (must type exact string)config — interactive config editoredit [name] — select menu if no name given, opens editorregister [name] — collects skillset metadata via group promptThese require registry access or authentication infrastructure:
login — requires real auth credentialsupload — requires registry accessdownload — requires registry accesssearch — requires registry accessinstall — requires registry accessdownload-skill — requires registry accesswatch — requires daemon lifecycle and org accessThese produce raw output and can be tested by running them directly and checking stdout:
list — prints skillset names, one per linecurrent — prints the active skillset namedir — prints or opens a directory pathinstall-location — prints the install locationcompletion — prints shell completion scriptclear — clears managed configurationlogout — removes auth credentialsMost interactive commands need pre-existing state. Here are common patterns:
# Create a skillset (needed by: switch, fork, edit, register)
mkdir -p "$E2E_DIR/.nori/profiles/test-skillset"
cat > "$E2E_DIR/.nori/profiles/test-skillset/nori.json" << 'EOF'
{"name":"test-skillset","version":"1.0.0","type":"skillset"}
EOF
# Create a config file (needed by: switch, init, config)
cat > "$E2E_DIR/.nori-config.json" << 'EOF'
{"activeSkillset":"test-skillset","version":"1.0.0"}
EOF
# Create an agent config directory (needed by: init, switch, factory-reset)
mkdir -p "$E2E_DIR/.claude"
echo "# Test CLAUDE.md" > "$E2E_DIR/.claude/CLAUDE.md"
# Create a second skillset (needed by: switch selection menu)
mkdir -p "$E2E_DIR/.nori/profiles/other-skillset"
cat > "$E2E_DIR/.nori/profiles/other-skillset/nori.json" << 'EOF'
{"name":"other-skillset","version":"1.0.0","type":"skillset"}
EOF
Select menus in clack use arrow keys for navigation and Enter to confirm:
# Select the first option (it's already highlighted)
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
# Select the second option
$SCRIPTS/tui-send "$SESSION" --keys "Down"
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
# Select the third option
$SCRIPTS/tui-send "$SESSION" --keys "Down"
$SCRIPTS/tui-send "$SESSION" --keys "Down"
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
Confirm prompts in clack respond to arrow keys, not y/n:
# Accept (Yes is the default for most prompts)
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
# Decline — move to "No" first
$SCRIPTS/tui-send "$SESSION" --keys "Left"
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
# Type text and confirm
$SCRIPTS/tui-send "$SESSION" "my-skillset-name"
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
After the command finishes, check the exit code via the tmux pane:
# After the command completes, send 'echo $?' to see the exit code
$SCRIPTS/tui-send "$SESSION" "echo \$?"
$SCRIPTS/tui-send "$SESSION" --keys "Enter"
$SCRIPTS/tui-assert "$SESSION" "0" 5 # or "1" for expected failure
Note: this only works if tui-start was given a shell command like bash -c 'env ... node $SKS ... ; echo EXIT:$?' rather than the node command directly, because a direct node command exits the tmux pane on completion. Prefer wrapping in bash:
$SCRIPTS/tui-start "$SESSION" "bash -c 'env NORI_GLOBAL_CONFIG=$E2E_DIR node $SKS <subcommand> [args]; echo EXIT_CODE:\$?; exec bash'"
This keeps the pane alive after the command finishes so you can assert on exit code and inspect output.