원클릭으로
add-shellspec-rule
Add a new ShellSpec grammar rule with tests, following project conventions
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a new ShellSpec grammar rule with tests, following project conventions
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | add-shellspec-rule |
| description | Add a new ShellSpec grammar rule with tests, following project conventions |
Follow these steps to add a new ShellSpec construct to the grammar:
rule_name (required): Name of the ShellSpec construct (e.g., "Tag", "Filter")type (required): One of block (needs End terminator), statement (single-line), directive (% prefixed)Research the construct in ShellSpec documentation. Understand its syntax, variants, and where it appears in real spec files.
Add the rule to grammar.js:
shellspec_ (e.g., shellspec_tag_statement)prec.right() with seq(keyword, ..., repeat($._terminated_statement), "End")seq(keyword, ...args)seq("%" + name, ...args)field() for named parts (e.g., field("description", ...))Register in _statement_not_subshell: Add the new rule to the choice array in _statement_not_subshell.
Create corpus tests in the appropriate test/corpus/*.txt file:
=== header, code, --- separator, S-expression ASTUpdate queries/highlights.scm: Add highlighting patterns for any new keywords.
Verify:
npm run generate — check for new conflicts (minimize them)npm test — all tests must passfor f in test/spec/*.sh; do tree-sitter parse "$f" 2>&1 | grep -c ERROR; doneUpdate documentation:
"Data:raw") — they force tokenizer behavior globallyprec(N) on simple alternatives can beat prec.right(M) on blocks at the initial ambiguity point[ ... ] is $.test_command in tree-sitter-bash, not literal bracket tokensDebug a ShellSpec parse failure by identifying ERROR nodes and tracing to grammar rules
Generate parser from grammar.js, run all tests, and verify spec files parse cleanly
Update highlights.scm to cover all grammar rules, detecting missing patterns
Run full pre-release validation - tests, spec parsing, highlight coverage, build