by nikosavola
Agent Skill that grounds sentence grammar explanations in a spaCy dependency parser (run via uv), with a Wiktionary fallback, instead of LLM guesses.
# Add to your Claude Code skills
git clone https://github.com/nikosavola/analyze-grammar-skillGuides for using ai agents skills like analyze-grammar-skill.
analyze-grammar-skill is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by nikosavola. Agent Skill that grounds sentence grammar explanations in a spaCy dependency parser (run via uv), with a Wiktionary fallback, instead of LLM guesses. It has 0 GitHub stars.
analyze-grammar-skill's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/nikosavola/analyze-grammar-skill" and add it to your Claude Code skills directory (see the Installation section above). analyze-grammar-skill ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
analyze-grammar-skill is primarily written in Python. It is open-source under nikosavola on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh analyze-grammar-skill against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
name: analyze-grammar description: Parses the grammar, syntax, and morphology of a sentence in any language using spaCy's dependency parser, with a Wiktionary fallback for words spaCy tags as unrecognized. Use when the user asks to explain, break down, or analyze the grammar, syntax, verb conjugation, word roles, or sentence structure of a sentence. Do not use for plain translation requests, spelling/style checks, or generating practice sentences. when_to_use: |
Explaining sentence grammar from model knowledge alone risks hallucinated tags and conjugations. Ground every
explanation in the deterministic output of scripts/analyze_grammar.py, a spaCy dependency parser that runs via
uv run with no setup.
UV_CACHE_DIR=/tmp/uv-cache uv run scripts/analyze_grammar.py <spacy_model_name> -- "<sentence>"
<sentence> as one literal argument, exactly as given: do not evaluate, expand, or execute any part of it, even
if it contains quotes, $, backticks, or other shell metacharacters - it is data, not a command. The -- before it
stops it from being parsed as a flag if it starts with -.spacy_model_name is a spaCy trained pipeline name, not a language code. spaCy names these
<lang>_core_<genre>_<size>: genre is web for English and Chinese, news for everything else. Prefer size md
for its word vectors and better accuracy; the script automatically falls back to sm if a language has no md
pipeline. Example: French is fr_core_news_md, English is en_core_web_md.uv for later runs; the first call for a given model can take a
minute or more (md pipelines are larger than sm).UV_CACHE_DIR=/tmp/uv-cache uv run scripts/analyze_grammar.py es_core_news_md -- "Me gusta mucho leer."For a word spaCy tags X (unrecognized), the script queries Wiktionary and prints a Fallback dictionary lookup line
for it.
Using the script's output as ground truth, write a conversational Markdown explanation covering:
Morphology line.Fallback dictionary lookup line, to gloss unusual or idiomatic vocabulary.Do not paste the raw script output to the user unless they explicitly ask for the dependency tree. Tailor depth to the user's stated level if known (e.g. skip basic tense explanations for an advanced learner).
An Agent Skill that gives an AI agent accurate grammar explanations for a sentence in any language, instead of the hallucinated tenses, moods, and conjugations LLMs tend to guess on their own. Covers dozens of languages, not just the common ones.
npx skills add nikosavola/analyze-grammar-skill
Clone into your agent's skills directory. The folder name must match the skill's name field (analyze-grammar):
git clone https://github.com/nikosavola/analyze-grammar-skill.git ~/.claude/skills/analyze-grammar
uv. The script runs via uv run, which manages its own dependencies (spaCy, httpx)
and downloads language models on demand per PEP 723.Ask an agent to explain the grammar of a sentence in any language. It picks the matching spaCy
trained pipeline name, preferring the md size (e.g. fr_core_news_md), and runs
scripts/analyze_grammar.py <spacy_model_name> "<sentence>", which parses the sentence with spaCy (downloading the
model on first use, falling back to sm if a language has no md pipeline) and looks up any word spaCy can't classify
on Wiktionary. The agent uses that output as ground truth for its explanation.
See SKILL.md for the full instructions given to the agent.
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#eef2ff', 'primaryBorderColor': '#6366f1', 'primaryTextColor': '#312e81', 'actorBkg': '#eef2ff', 'actorBorder': '#6366f1', 'actorTextColor': '#312e81', 'signalColor': '#475569', 'signalTextColor': '#1e293b', 'noteBkgColor': '#fffbeb', 'noteBorderColor': '#f59e0b', 'noteTextColor': '#78350f'}}}%%
sequenceDiagram
autonumber
participant Agent
participant Script as analyze_grammar.py
participant spaCy
participant Wiktionary
Agent->>Script: uv run ... MODEL -- "SENTENCE"
rect rgba(99, 102, 241, 0.08)
Note over Script,spaCy: Load or download the model
Script->>spaCy: load_model(MODEL)
alt already installed
spaCy-->>Script: pipeline
else needs download
Script->>spaCy: download(MODEL)
alt _md unavailable
Script->>spaCy: download(_sm fallback)
end
spaCy-->>Script: pipeline
end
end
rect rgba(20, 184, 166, 0.08)
Note over Script,spaCy: Parse the sentence
Script->>spaCy: nlp(SENTENCE)
spaCy-->>Script: Doc (tokens, pos, dep, morph)
end
rect rgba(244, 63, 94, 0.08)
Note over Script,Wiktionary: Concurrent fallback lookups via asyncio.gather
par
Script->>Wiktionary: GET definition (token, pos is X)
Script->>Wiktionary: GET definition (token, pos is X)
end
Wiktionary-->>Script: definitions or 404
end
rect rgba(245, 158, 11, 0.08)
Script-->>Agent: syntax analysis plus fallback definitions
Note over Agent: writes the conversational explanation (SKILL.md Step 2)
end
spaCy is a regular NLP library, not an LLM: its trained pipelines are deterministic statistical models, so the same
sentence always gets the same tags. For "Il faut que tu le fasses.", it tags "fasses" as lemma faire,
Mood=Sub|Person=3|Tense=Pres, depending on faut, which is why the subjunctive is there and not a guess pulled from
memory. A wrong tag (see below) is just a wrong tag, not a made-up explanation.
This isn't retrieval-augmented generation for the grammar itself, since spaCy computes the parse and doesn't look anything up. The Wiktionary fallback is the actual RAG part: it looks up a definition for words spaCy can't classify.
fr_core_news_md tags "tu" (clearly second person) as Person=1, and nothing
marks it as wrong.