[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CWG7FVN4W7QMVN1ND5PV56":3,"skill-same:01M6CWG7FVN4W7QMVN1ND5PV56":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":24,"frontMatter":25,"refName":29,"commitSha":30,"skillDirectory":5,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M6CWG7FVN4W7QMVN1ND5PV56","automata",null,"Automata theory and computation","ffsshhttiikk\u002Fopencode-agents-skills","ffsshhttiikk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F226346827?v=4","01M6CWD9RR3Y7VRQX3MXYC8FYH","01M6CWD9WVPYAZW0J82G1VKGHY",3,"MIT","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fautomata\u002FSKILL.md",[],[5,18,19,20],"science","computer","opencode","2026-11-10 10:12:30",false,"---\nname: automata\ndescription: Automata theory and computation\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  audience: developers\n  category: computer-science\n---\n\n## What I do\n- Implement finite automata\n- Design regular expressions\n- Build parsers and lexers\n- Understand computational limits\n\n## When to use me\nWhen building text processors, lexical analyzers, or pattern matchers.\n\n## Finite Automata\n\n### Deterministic Finite Automaton\n```python\nfrom typing import Set, Dict\n\nclass DFA:\n    \"\"\"Deterministic Finite Automaton\"\"\"\n    \n    def __init__(self, states: Set[str], alphabet: Set[str],\n                 transition: Dict[str, Dict[str, str]],\n                 start_state: str, accept_states: Set[str]):\n        self.states = states\n        self.alphabet = alphabet\n        self.transition = transition\n        self.start_state = start_state\n        self.accept_states = accept_states\n    \n    def accept(self, input_string: str) -> bool:\n        \"\"\"Check if DFA accepts input\"\"\"\n        current = self.start_state\n        \n        for symbol in input_string:\n            if symbol not in self.alphabet:\n                return False\n            \n            if current not in self.transition:\n                return False\n            \n            if symbol not in self.transition[current]:\n                return False\n            \n            current = self.transition[current][symbol]\n        \n        return current in self.accept_states\n    \n    def simulate(self, input_string: str) -> Dict:\n        \"\"\"Simulate DFA and return trace\"\"\"\n        trace = [{\"state\": self.start_state, \"input\": \"\"}]\n        current = self.start_state\n        \n        for i, symbol in enumerate(input_string):\n            if current in self.transition and symbol in self.transition[current]:\n                current = self.transition[current][symbol]\n                trace.append({\"state\": current, \"input\": input_string[:i+1]})\n        \n        return {\n            \"accepted\": current in self.accept_states,\n            \"final_state\": current,\n            \"trace\": trace\n        }\n\n# Example: Binary strings divisible by 3\ndivisible_by_3_dfa = DFA(\n    states={\"q0\", \"q1\", \"q2\"},\n    alphabet={\"0\", \"1\"},\n    transition={\n        \"q0\": {\"0\": \"q0\", \"1\": \"q1\"},\n        \"q1\": {\"0\": \"q2\", \"1\": \"q0\"},\n        \"q2\": {\"0\": \"q1\", \"1\": \"q2\"}\n    },\n    start_state=\"q0\",\n    accept_states={\"q0\"}\n)\n```\n\n### Nondeterministic Finite Automaton\n```python\nclass NFA:\n    \"\"\"Nondeterministic Finite Automaton\"\"\"\n    \n    def __init__(self, states: Set[str], alphabet: Set[str],\n                 transition: Dict[str, Dict[str, Set[str]]],\n                 epsilon_transition: Dict[str, Set[str]],\n                 start_state: str, accept_states: Set[str]):\n        self.states = states\n        self.alphabet = alphabet\n        self.transition = transition\n        self.epsilon_transition = epsilon_transition\n        self.start_state = start_state\n        self.accept_states = accept_states\n    \n    def epsilon_closure(self, states: Set[str]) -> Set[str]:\n        \"\"\"Compute epsilon closure of states\"\"\"\n        closure = set(states)\n        stack = list(states)\n        \n        while stack:\n            state = stack.pop()\n            if state in self.epsilon_transition:\n                for next_state in self.epsilon_transition[state]:\n                    if next_state not in closure:\n                        closure.add(next_state)\n                        stack.append(next_state)\n        \n        return closure\n    \n    def move(self, states: Set[str], symbol: str) -> Set[str]:\n        \"\"\"Compute move operation\"\"\"\n        result = set()\n        \n        for state in states:\n            if state in self.transition and symbol in self.transition[state]:\n                result.update(self.transition[state][symbol])\n        \n        return result\n    \n    def accept(self, input_string: str) -> bool:\n        \"\"\"Check if NFA accepts input\"\"\"\n        current = self.epsilon_closure({self.start_state})\n        \n        for symbol in input_string:\n            current = self.epsilon_closure(self.move(current, symbol))\n        \n        return bool(current & self.accept_states)\n```\n\n### Regular Expressions to NFA (Thompson's Construction)\n```python\nclass RegexToNFA:\n    \"\"\"Convert regex to NFA using Thompson's construction\"\"\"\n    \n    def __init__(self):\n        self.state_counter = 0\n    \n    def create_state(self) -> str:\n        \"\"\"Create unique state\"\"\"\n        state = f\"q{self.state_counter}\"\n        self.state_counter += 1\n        return state\n    \n    def build_nfa(self, regex: str) -> NFA:\n        \"\"\"Build NFA from regex\"\"\"\n        # Simplified: parse and build NFA\n        # In practice, use proper regex parser\n        pass\n    \n    def union(self, nfa1: NFA, nfa2: NFA) -> NFA:\n        \"\"\"Union of two NFAs\"\"\"\n        start = self.create_state()\n        accept = self.create_state()\n        \n        new_transition = {}\n        new_transition[start] = {\"\": {nfa1.start_state, nfa2.start_state}}\n        \n        # Connect accept states to new accept\n        for state in nfa1.accept_states:\n            if state not in new_transition:\n                new_transition[state] = {}\n            new_transition[state][\"\"] = {accept}\n        \n        return NFA(\n            states=\"...\",\n            alphabet=\"...\",\n            transition=new_transition,\n            epsilon_transition=\"...\",\n            start_state=start,\n            accept_states={accept}\n        )\n```\n\n### Pushdown Automaton\n```python\nclass PDA:\n    \"\"\"Pushdown Automaton for context-free languages\"\"\"\n    \n    def __init__(self, states: Set[str], alphabet: Set[str],\n                 stack_alphabet: Set[str],\n                 transition: Dict[str, Dict[str, Dict[str, tuple]]],\n                 start_state: str, accept_states: Set[str]):\n        self.states = states\n        self.alphabet = alphabet\n        self.stack_alphabet = stack_alphabet\n        self.transition = transition\n        self.start_state = start_state\n        self.accept_states = accept_states\n    \n    def accept(self, input_string: str, mode: str = \"final\") -> bool:\n        \"\"\"Check if PDA accepts input\"\"\"\n        stack = [\"$\"]\n        state = self.start_state\n        input_pos = 0\n        \n        while input_pos \u003C= len(input_string):\n            # Try epsilon transition\n            if self._epsilon_transition(state, stack):\n                state, stack = self._apply_transition(\n                    state, \"\", stack, \"ε\"\n                )\n            \n            # Try symbol transition\n            if input_pos \u003C len(input_string):\n                symbol = input_string[input_pos]\n                if self._symbol_transition(state, symbol, stack):\n                    state, stack = self._apply_transition(\n                        state, symbol, stack, symbol\n                    )\n                    input_pos += 1\n            \n            # Check for acceptance\n            if input_pos == len(input_string) and state in self.accept_states:\n                return True\n        \n        return False\n```\n","## What I do\n- Implement finite automata\n- Design regular expressions\n- Build parsers and lexers\n- Understand computational limits\n\n## When to use me\nWhen building text processors, lexical analyzers, or pattern matchers.\n\n## Finite Automata\n\n### Deterministic Finite Automaton\n```python\nfrom typing import Set, Dict\n\nclass DFA:\n    \"\"\"Deterministic Finite Automaton\"\"\"\n    \n    def __init__(self, states: Set[str], alphabet: Set[str],\n                 transition: Dict[str, Dict[str, str]],\n                 start_state: str, accept_states: Set[str]):\n        self.states = states\n        self.alphabet = alphabet\n        self.transition = transition\n        self.start_state = start_state\n        self.accept_states = accept_states\n    \n    def accept(self, input_string: str) -> bool:\n        \"\"\"Check if DFA accepts input\"\"\"\n        current = self.start_state\n        \n        for symbol in input_string:\n            if symbol not in self.alphabet:\n                return False\n            \n            if current not in self.transition:\n                return False\n            \n            if symbol not in self.transition[current]:\n                return False\n            \n            current = self.transition[current][symbol]\n        \n        return current in self.accept_states\n    \n    def simulate(self, input_string: str) -> Dict:\n        \"\"\"Simulate DFA and return trace\"\"\"\n        trace = [{\"state\": self.start_state, \"input\": \"\"}]\n        current = self.start_state\n        \n        for i, symbol in enumerate(input_string):\n            if current in self.transition and symbol in self.transition[current]:\n                current = self.transition[current][symbol]\n                trace.append({\"state\": current, \"input\": input_string[:i+1]})\n        \n        return {\n            \"accepted\": current in self.accept_states,\n            \"final_state\": current,\n            \"trace\": trace\n        }\n\n# Example: Binary strings divisible by 3\ndivisible_by_3_dfa = DFA(\n    states={\"q0\", \"q1\", \"q2\"},\n    alphabet={\"0\", \"1\"},\n    transition={\n        \"q0\": {\"0\": \"q0\", \"1\": \"q1\"},\n        \"q1\": {\"0\": \"q2\", \"1\": \"q0\"},\n        \"q2\": {\"0\": \"q1\", \"1\": \"q2\"}\n    },\n    start_state=\"q0\",\n    accept_states={\"q0\"}\n)\n```\n\n### Nondeterministic Finite Automaton\n```python\nclass NFA:\n    \"\"\"Nondeterministic Finite Automaton\"\"\"\n    \n    def __init__(self, states: Set[str], alphabet: Set[str],\n                 transition: Dict[str, Dict[str, Set[str]]],\n                 epsilon_transition: Dict[str, Set[str]],\n                 start_state: str, accept_states: Set[str]):\n        self.states = states\n        self.alphabet = alphabet\n        self.transition = transition\n        self.epsilon_transition = epsilon_transition\n        self.start_state = start_state\n        self.accept_states = accept_states\n    \n    def epsilon_closure(self, states: Set[str]) -> Set[str]:\n        \"\"\"Compute epsilon closure of states\"\"\"\n        closure = set(states)\n        stack = list(states)\n        \n        while stack:\n            state = stack.pop()\n            if state in self.epsilon_transition:\n                for next_state in self.epsilon_transition[state]:\n                    if next_state not in closure:\n                        closure.add(next_state)\n                        stack.append(next_state)\n        \n        return closure\n    \n    def move(self, states: Set[str], symbol: str) -> Set[str]:\n        \"\"\"Compute move operation\"\"\"\n        result = set()\n        \n        for state in states:\n            if state in self.transition and symbol in self.transition[state]:\n                result.update(self.transition[state][symbol])\n        \n        return result\n    \n    def accept(self, input_string: str) -> bool:\n        \"\"\"Check if NFA accepts input\"\"\"\n        current = self.epsilon_closure({self.start_state})\n        \n        for symbol in input_string:\n            current = self.epsilon_closure(self.move(current, symbol))\n        \n        return bool(current & self.accept_states)\n```\n\n### Regular Expressions to NFA (Thompson's Construction)\n```python\nclass RegexToNFA:\n    \"\"\"Convert regex to NFA using Thompson's construction\"\"\"\n    \n    def __init__(self):\n        self.state_counter = 0\n    \n    def create_state(self) -> str:\n        \"\"\"Create unique state\"\"\"\n        state = f\"q{self.state_counter}\"\n        self.state_counter += 1\n        return state\n    \n    def build_nfa(self, regex: str) -> NFA:\n        \"\"\"Build NFA from regex\"\"\"\n        # Simplified: parse and build NFA\n        # In practice, use proper regex parser\n        pass\n    \n    def union(self, nfa1: NFA, nfa2: NFA) -> NFA:\n        \"\"\"Union of two NFAs\"\"\"\n        start = self.create_state()\n        accept = self.create_state()\n        \n        new_transition = {}\n        new_transition[start] = {\"\": {nfa1.start_state, nfa2.start_state}}\n        \n        # Connect accept states to new accept\n        for state in nfa1.accept_states:\n            if state not in new_transition:\n                new_transition[state] = {}\n            new_transition[state][\"\"] = {accept}\n        \n        return NFA(\n            states=\"...\",\n            alphabet=\"...\",\n            transition=new_transition,\n            epsilon_transition=\"...\",\n            start_state=start,\n            accept_states={accept}\n        )\n```\n\n### Pushdown Automaton\n```python\nclass PDA:\n    \"\"\"Pushdown Automaton for context-free languages\"\"\"\n    \n    def __init__(self, states: Set[str], alphabet: Set[str],\n                 stack_alphabet: Set[str],\n                 transition: Dict[str, Dict[str, Dict[str, tuple]]],\n                 start_state: str, accept_states: Set[str]):\n        self.states = states\n        self.alphabet = alphabet\n        self.stack_alphabet = stack_alphabet\n        self.transition = transition\n        self.start_state = start_state\n        self.accept_states = accept_states\n    \n    def accept(self, input_string: str, mode: str = \"final\") -> bool:\n        \"\"\"Check if PDA accepts input\"\"\"\n        stack = [\"$\"]\n        state = self.start_state\n        input_pos = 0\n        \n        while input_pos \u003C= len(input_string):\n            # Try epsilon transition\n            if self._epsilon_transition(state, stack):\n                state, stack = self._apply_transition(\n                    state, \"\", stack, \"ε\"\n                )\n            \n            # Try symbol transition\n            if input_pos \u003C len(input_string):\n                symbol = input_string[input_pos]\n                if self._symbol_transition(state, symbol, stack):\n                    state, stack = self._apply_transition(\n                        state, symbol, stack, symbol\n                    )\n                    input_pos += 1\n            \n            # Check for acceptance\n            if input_pos == len(input_string) and state in self.accept_states:\n                return True\n        \n        return False\n```\n",{"name":5,"license":14,"metadata":26,"description":7,"compatibility":20},{"audience":27,"category":28},"developers","computer-science","main","5f7a3e453c98261f93d19a6a7de44ad8f7b72d41",2,"https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk","2026-03-01 06:55:40",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill automata",{"tool":41,"command":42},"bunx","bunx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill automata",{"tool":44,"command":45},"pnpm","pnpm dlx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill automata","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fautomata\u002FSKILL.md",true,[],[50,61,70,79,89,98],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":21},"01M6CXT9TXDF79BWJTMQAPB49G","xamarin","Xamarin cross-platform development","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fxamarin\u002FSKILL.md",[],[52,57,58,59,20,60],"platform","cross-platform","mobile","development",{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":21},"01M6CXT8AD04MFYDA32VW3FKAG","wrangling","Data wrangling fundamentals","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwrangling\u002FSKILL.md",[],[63,68,20,18,69],"data wrangling","data",{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":21},"01M6CXT717GCN7SRRNPBDP4508","windows","Windows operating system administration and scripting","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwindows\u002FSKILL.md",[],[72,77,20,78],"system","scripting",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":21},"01M6CXT54K794NMEM3XAPZZDKT","wide-column","Wide-column data model","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column\u002FSKILL.md",[],[86,87,20,88,69],"wide column","databases","model",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":21},"01M6CXT28FMT2P4V9GZE67WA8E","wide-column-stores","Wide-column database stores","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column-stores\u002FSKILL.md",[],[96,87,20,97],"wide column stores","database",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":21},"01M6CXT0D0M0Q4T2N7C2RX7DSN","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwebsockets\u002FSKILL.md",[],[100,105,106,107,20,108,109],"websocket","real-time","time","best practices","implementation"]