跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

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

tilework-tech · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add tilework-tech/nori-skillsets --skill E2E Testing Nori Skillsets Subcommands

技能说明


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

  1. Run e2e-setup to build the project and create the isolated environment
source {{skills_dir}}/e2e-testing-skillsets/e2e-setup

The script prints the variables it exports. Verify E2E_DIR, SKS, and NORI_GLOBAL_CONFIG are set.

  1. Read the TUI Puppeteering skill
Read {{skills_dir}}/tui-puppeteering-with-tmux/SKILL.md

Follow its instructions exactly. All tmux interaction goes through its scripts.

  1. Write a test plan for the specified subcommand

Before touching tmux, write out a concrete plan:

  • What subcommand you are testing and what behavior you want to verify
  • What seed data you need to create in $E2E_DIR before launching the command
  • The exact tui-start command you will use (must include the env wrapper shown below)
  • The assert-act-assert sequence: what text you expect on screen, what input you will send, what text you expect after
  1. Seed any required test data in $E2E_DIR

Many 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"
  1. Execute the test using TUI puppeteering

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.

  1. Verify filesystem side effects

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.

  1. Clean up
$SCRIPTS/tui-stop "$SESSION"
{{skills_dir}}/e2e-testing-skillsets/e2e-teardown

Always stop tmux first, then tear down the filesystem.

Isolation Rules

  • All commands MUST run with 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.
  • Always use env NORI_GLOBAL_CONFIG=$E2E_DIR node $SKS ... as the command passed to tui-start. Never run bare nori-skillsets or sks.
  • Never run npm link. The built CLI is executed directly via node.
  • The e2e directory is always /tmp/nori/skillsets-e2e-scenario/. The e2e-setup script wipes and recreates it on every run.
  • After the test, verify isolation. Check that ~/.nori/ and ~/.claude/ were not modified. The e2e-teardown script does this automatically.

UI Conventions to Assert

These are the authoritative conventions for nori-skillsets interactive subcommands. Use them to decide what to assert in your test plan.

Framing

  • Every interactive subcommand begins with a clack intro line. The intro text is a short, descriptive title in infinitive verb form (e.g., "Switch Skillset", "Initialize Nori"). It appears as a horizontal bar with the title.
  • On success, every interactive subcommand ends with a clack outro line. The outro text uses past tense or describes the next step the user should take. It contains the most salient piece of information from the operation (e.g., the email that was logged in, the skillset name that was created).
  • On cancellation, no outro is displayed. The flow returns silently after showing a clack cancel message (a short italic line like "Login cancelled.").
  • On failure, some commands display an outro with the error and then exit with code 1 (via exitOnFailure). Others display the error inline (via log.error) and show a normal outro. Check the specific command's behavior.
  • Uncaught exceptions always produce an outro prefixed with "Error: " followed by the error message, then exit with code 1.

Prompts

  • Text inputs show a message and an optional placeholder. Validation errors appear inline below the prompt.
  • Password inputs mask characters. Otherwise identical to text.
  • Select menus show a list of options. The user navigates with arrow keys and confirms with Enter.
  • Confirm prompts show a yes/no question. The user presses y or n.
  • Group prompts collect multiple inputs in sequence. If the user cancels any input in the group, the entire group is cancelled.
  • Cancellation at any prompt produces a short cancel message (e.g., "Skillset creation cancelled.") and the command returns without showing an outro.

Spinners

  • Long-running operations are wrapped in a clack spinner. The spinner shows a start message (present participle, e.g., "Authenticating...") and a stop message (past tense, e.g., "Authenticated").
  • On failure, the spinner stop message describes the failure (e.g., "Authentication failed").

Notes

  • Notes (note(content, title)) are used for multi-line structured information: change summaries, next steps, account details, artifact listings, diffs, warnings.
  • Notes are never used for single-line errors. Use log.error() for that.
  • If a hint or additional context accompanies an error, the error is shown via log.error() and the hint is shown in a separate note titled "Hint".
  • Notes always appear before the outro, never after.

Styling

  • Bold ANSI (\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
阅读完整来源 ↗