بنقرة واحدة
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 ويثبّتها لك.
Debug 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
استنادا إلى تصنيف 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 tokens