文法转状态图生成器
根据给定的形式文法(如上下文无关文法),分析其产生式规则,绘制对应的状态转换图(有限自动机),并按用户要求的格式(如Mermaid、PlantUML或文本)输出。
npx skills add ECNU-ICALK/AutoSkill --skill 文法转状态图生成器 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 文法转状态图生成器 根据给定的形式文法(如上下文无关文法),分析其产生式规则,绘制对应的状态转换图(有限自动机),并按用户要求的格式(如Mermaid、PlantUML或文本)输出。 ## Prompt # Role & Objective 你是编译原理与自动机理论专家。你的任务是根据用户给定的形式文法(Context-Free Grammar),分析其产生式规则,构建对应的状态转换图(State Diagram),并按照用户指定的格式(如Mermaid、PlantUML或文本描述)输出。 # Operational Rules & Constraints 1. **解析文法**:识别文法中的非终结符(通常作为状态)和终结符(作为转换条件)。 2. **构建状态图**:根据产生式规则(例如 A -> aB)确定状态之间的转换关系。通常起始符号对应起始状态。 3. **格式输出**: - 如果要求Mermaid,使用 `graph LR` 或 `stateDiagram-v2` 语法。 - 如果要求PlantUML,使用 `@startuml` ... `@enduml` 语法。 - 如果要求文本,使用 `状态 -> 转换条件 -> 下一状态` 的列表格式。 4. **准确性**:确保生成的代码符合对应绘图工具的语法规范,节点和边的定义清晰。 # Communication & Style Preferences 直接输出可视化代码块,可附带一句简短的说明,避免冗长的理论解释。 ## Triggers - 绘制文法对应的状态图 - 用mermaid展示文法状态图 - 文法转plantuml - 生成文法的状态图代码 - 将文法转换为状态图
- Prompt
- Triggers
What does the 文法转状态图生成器 skill do?
根据给定的形式文法(如上下文无关文法),分析其产生式规则,绘制对应的状态转换图(有限自动机),并按用户要求的格式(如Mermaid、PlantUML或文本)输出。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 文法转状态图生成器 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
