tree-sitter-fsharp: Skill for OpenCode

.opencode/skills/tree-sitter-tdd/SKILL.md

tree-sitter-tdd is a skill for OpenCode from ionide/tree-sitter-fsharp. It costs 25 tokens per session (2,703 once invoked), scanned A, original, MIT.

A guided test-first workflow for adding or fixing F# syntax in the tree-sitter parser. Tree-sitter is a tool that turns source code into a structured syntax tree, while TDD means writing tests before implementation.

In plain words
What is it for?
Adding new F# expressions, patterns, or keywords, and fixing parsing errors. It compares F# compiler syntax data with tree-sitter's format and checks the result against parser tests.
Why use it?
It reduces guesswork when parser changes fail or break existing syntax. The workflow keeps iterating until every test passes.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions subagents; mentions OpenCode.

This is ionide/tree-sitter-fsharp's own configuration. It tells OpenCode how to work on tree-sitter-fsharp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tree-sitter-fsharp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ionide/tree-sitter-fsharp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ionide/tree-sitter-fsharp/main/.opencode/skills/tree-sitter-tdd/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ionide/tree-sitter-fsharp

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tree-sitter-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/ionide/tree-sitter-fsharp/tree-sitter-tdd/github.svg)](https://agentmods.dev/skills/ionide/tree-sitter-fsharp/tree-sitter-tdd)
Your own site
<a href="https://agentmods.dev/skills/ionide/tree-sitter-fsharp/tree-sitter-tdd"><img src="https://agentmods.dev/badge/skills/ionide/tree-sitter-fsharp/tree-sitter-tdd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tree-sitter-tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/ionide/tree-sitter-fsharp/tree-sitter-tdd"><img src="https://agentmods.dev/badge/skills/ionide/tree-sitter-fsharp/tree-sitter-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,703 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 12 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 38
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 39
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 148
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 160
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 177
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 191
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 218
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 227
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 329
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 330
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 331
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 332
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.02703
Opus 5 $0.00013 $0.01352
Sonnet 5 $0.00005 $0.00541
Haiku 4.5 $0.00003 $0.00270

Measured 9d ago against content hash 9fdce3ca40c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

tree-sitter-tdd scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/skills/tree-sitter-tdd/SKILL.md · 339 lines

How it starts

The opening of the file, as written. The whole thing — 339 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tree-Sitter TDD Skill

Overview

Use this skill when adding a new F# language feature to the tree-sitter parser. This skill automates the TDD workflow: write test first, get Fantomas AST, map to tree-sitter format, verify with user, and then strictly orchestrate multi-agent iteration—spawning per-test subagents for parse fixes until all test cases pass. Full green suite is mandatory.

Critical: This workflow loops—using delegated subagents—until ALL tests pass. Adding a feature may break existing tests; every breakage is isolated and fixed before success is declared.

When to Use

  • Adding a new language feature (e.g., new expression type, pattern, keyword)
  • Fixing a parsing issue with existing syntax

Prerequisite

  • The script ast_parser.fsx at project root must accept the code example as a command-line argument. If it does not, update the script before continuing. See Step 1 for the exact required change.

Input

The user provides:

  1. F# code snippet to parse
  2. Test name (e.g., "nullable type")
  3. Corpus file (e.g., test/corpus/type_defn.txt)

Workflow

Multi-Agent Orchestration Pattern

After a new test is written and (expectedly) fails, use the following orchestration:

  • Spawn a subagent (with the tree-sitter-parse-testing skill) to iterate on parser and grammar only for the failing example until it parses as required.
    • IMPORTANT: The subagent must focus on fixing that single test case. The subagent should never call npx tree-sitter test or attempt to fix multiple cases. It is strictly one subagent per failing test.
  • Once that test parses, run the entire test suite (npx tree-sitter test).
  • For every other test that fails, spawn a new subagent, each focusing solely on its failing case.
  • Continue this loop, always re-running and spawning as needed, until all tests pass.
  • Never “fix everything at once”; maintain one-failure-at-a-time discipline per subagent.

This coordination ensures robust TDD and protects against missed breakages elsewhere in the corpus. (See Step 7 for concrete mechanics.)

Read the full file on GitHub · 339 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 339 lines · 25 tokens per session scan A 9fdce3ca40c5

Subscribe to this mod's changes

tree-sitter-tdd is a skill published in the GitHub repository ionide/tree-sitter-fsharp (96 stars, last pushed 6d ago), licensed MIT. It adds 25 tokens to every session and 2,703 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.