Problem
The test:sh script in packages/agents/package.json hardcodes its target directory:
"test:sh": "shellspec content/scripts/"
Because nothing forwards positional arguments to shellspec, callers cannot narrow a run to a specific test file. Iterating on a single test requires running the full suite or invoking shellspec directly outside the workspace script.
Context
shellspec accepts [files or directories...] as positional arguments. Passing one or more file paths runs just those files; passing nothing falls back to discovery via .shellspec (--pattern "*_test.sh" against the current directory).
- Test files live under
packages/agents/content/scripts/__tests__/ (e.g., get_ticket_id_test.sh).
- The script is invoked from the monorepo root via
pnpm --filter @codeassembly/agents test:sh, with -- separating pnpm args from forwarded args.
Solution
Update the test:sh script to forward positional arguments when supplied and fall back to the current directory target when not, using POSIX default-value parameter expansion:
"test:sh": "shellspec \"${@:-content/scripts/}\""
This preserves the existing zero-argument behavior and enables targeted invocations such as:
pnpm --filter @codeassembly/agents test:sh -- content/scripts/__tests__/get_ticket_id_test.sh
Acceptance criteria
Problem
The
test:shscript inpackages/agents/package.jsonhardcodes its target directory:Because nothing forwards positional arguments to
shellspec, callers cannot narrow a run to a specific test file. Iterating on a single test requires running the full suite or invokingshellspecdirectly outside the workspace script.Context
shellspecaccepts[files or directories...]as positional arguments. Passing one or more file paths runs just those files; passing nothing falls back to discovery via.shellspec(--pattern "*_test.sh"against the current directory).packages/agents/content/scripts/__tests__/(e.g.,get_ticket_id_test.sh).pnpm --filter @codeassembly/agents test:sh, with--separating pnpm args from forwarded args.Solution
Update the
test:shscript to forward positional arguments when supplied and fall back to the current directory target when not, using POSIX default-value parameter expansion:This preserves the existing zero-argument behavior and enables targeted invocations such as:
Acceptance criteria
pnpm --filter @codeassembly/agents test:sh(no args) runs all tests undercontent/scripts/, matching today's behavior.pnpm --filter @codeassembly/agents test:sh -- <path-to-test-file>runs only the specified test file.--example).