[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E52PC5W7H3Z9FRCSMZB5R6":3,"skill-same:01M6E52PC5W7H3Z9FRCSMZB5R6":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6E52PC5W7H3Z9FRCSMZB5R6","discrete-mathematics-expert",null,"Expert-level discrete mathematics knowledge. Use when working with logic, set theory, combinatorics, graph theory, relations, functions, induction, recursion, boolean algebra, or discrete probability. Also use when the user mentions 'combinatorics', 'permutations', 'combinations', 'pigeonhole principle', 'inclusion-exclusion', 'generating functions', 'recurrence relations', 'graph theory', 'trees', 'logic', 'propositional calculus', or 'boolean algebra'.","luokai0\u002Fai-agent-skills-by-luo-kai","luokai0","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F266954973?v=4","01M6E16VNT42JB8B3X3254QWJ7","luo kai","01M6E16VTFVP6S5XJF1V1MPV90",14,"MIT","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F13-physics-and-mathematics (by Luo Kai)\u002Fdiscrete-mathematics-expert\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"discrete mathematics expert","expert","mathematics","inclusion","logic","combinations","permutations","Graph Theory","probability","combinatorics","calculus","algebra","graph","functions","use","user","knowledge","science","SET","2026-11-10 10:12:30",false,"---\nauthor: luo-kai\nname: discrete-mathematics-expert\ndescription: Expert-level discrete mathematics knowledge. Use when working with logic, set theory, combinatorics, graph theory, relations, functions, induction, recursion, boolean algebra, or discrete probability. Also use when the user mentions 'combinatorics', 'permutations', 'combinations', 'pigeonhole principle', 'inclusion-exclusion', 'generating functions', 'recurrence relations', 'graph theory', 'trees', 'logic', 'propositional calculus', or 'boolean algebra'.\nlicense: MIT\nmetadata:\n  author: luokai25\n  version: \"1.0\"\n  category: science\n---\n\n# Discrete Mathematics Expert\n\nYou are a world-class mathematician with deep expertise in discrete mathematics covering logic, set theory, combinatorics, graph theory, number theory applications, recurrence relations, generating functions, and discrete probability.\n\n## Before Starting\n\n1. **Topic** — Logic, combinatorics, graph theory, recurrences, or discrete probability?\n2. **Level** — High school, undergraduate, or graduate?\n3. **Goal** — Solve counting problem, prove result, or understand concept?\n4. **Context** — Pure math, computer science, or cryptography?\n5. **Approach** — Combinatorial, algebraic, or algorithmic?\n\n---\n\n## Core Expertise Areas\n\n- **Logic**: propositional, predicate, proof techniques\n- **Set Theory**: operations, relations, functions, cardinality\n- **Combinatorics**: counting, permutations, combinations, inclusion-exclusion\n- **Advanced Counting**: generating functions, Stirling numbers, partitions\n- **Graph Theory**: paths, trees, planarity, coloring, matchings\n- **Recurrence Relations**: solving, characteristic equations, generating functions\n- **Discrete Probability**: sample spaces, distributions, expectation\n- **Boolean Algebra**: logic circuits, normal forms, Karnaugh maps\n\n---\n\n## Logic\n\n### Propositional Logic\n```\nConnectives:\n  ¬p (not), p∧q (and), p∨q (or), p→q (implies), p↔q (iff)\n  p→q ≡ ¬p∨q  (implication as disjunction)\n  ¬(p∧q) ≡ ¬p∨¬q, ¬(p∨q) ≡ ¬p∧¬q  (De Morgan's)\n\nTruth table analysis:\n  p→q: only false when p true, q false\n  Contrapositive: p→q ≡ ¬q→¬p  (logically equivalent!)\n  Converse: q→p  (NOT equivalent to p→q)\n  Inverse: ¬p→¬q  (NOT equivalent)\n\nTautology: true for all assignments (p∨¬p)\nContradiction: false for all (p∧¬p)\nContingency: neither\n\nImportant equivalences:\n  Idempotent:    p∧p ≡ p, p∨p ≡ p\n  Commutative:   p∧q ≡ q∧p\n  Associative:   (p∧q)∧r ≡ p∧(q∧r)\n  Distributive:  p∧(q∨r) ≡ (p∧q)∨(p∧r)\n  Absorption:    p∧(p∨q) ≡ p\n  Double neg:    ¬(¬p) ≡ p\n```\n\n### Predicate Logic & Proof Techniques\n```\nQuantifiers:\n  ∀x P(x): for all x, P(x) is true\n  ∃x P(x): there exists x such that P(x)\n  Negation: ¬∀x P(x) ≡ ∃x ¬P(x)\n            ¬∃x P(x) ≡ ∀x ¬P(x)\n\nProof techniques:\n  Direct: assume hypothesis, derive conclusion\n  Contrapositive: prove ¬q→¬p instead of p→q\n  Contradiction: assume ¬p, derive contradiction → p true\n  Cases: split into exhaustive cases, prove each\n  Induction: base case + inductive step\n  Construction: prove existence by building example\n  Counterexample: disprove universal claim\n\nMathematical induction:\n  Base case: P(n₀)\n  Inductive step: P(k) → P(k+1)\n  Conclusion: P(n) for all n ≥ n₀\n\nStrong induction:\n  Assume P(n₀),...,P(k) all hold → P(k+1)\n  Useful for recursively defined sequences\n  Well-ordering principle: every nonempty set of positive integers has minimum\n```\n\n---\n\n## Set Theory\n```\nSet operations:\n  A∪B: union, A∩B: intersection, A\\B: difference, Aᶜ: complement\n  A×B: Cartesian product {(a,b): a∈A, b∈B}\n  P(A): power set {S: S⊆A}, |P(A)| = 2^|A|\n\nSet identities (De Morgan's, distributive, etc.):\n  A∩(B∪C) = (A∩B)∪(A∩C)\n  A∪(B∩C) = (A∪B)∩(A∪C)\n  (A∪B)ᶜ = Aᶜ∩Bᶜ, (A∩B)ᶜ = Aᶜ∪Bᶜ\n\nRelations on A:\n  Binary relation R ⊆ A×A\n  Reflexive: aRa for all a\n  Symmetric: aRb → bRa\n  Antisymmetric: aRb and bRa → a=b\n  Transitive: aRb and bRc → aRc\n\nEquivalence relation: reflexive + symmetric + transitive\n  Partitions set into equivalence classes [a] = {b: aRb}\n\nPartial order: reflexive + antisymmetric + transitive\n  Total order: also comparable (a≤b or b≤a)\n  Well-order: total order + every nonempty subset has minimum\n\nFunctions:\n  Injective (1-1): f(a)=f(b) → a=b\n  Surjective (onto): ∀b ∃a: f(a)=b\n  Bijective: injective and surjective\n  Inverse exists ↔ bijective\n\nCardinality:\n  |A|=|B|: bijection exists (A and B equinumerous)\n  Countable: bijection with ℕ (or finite)\n  ℤ, ℚ countable; ℝ uncountable (Cantor diagonal)\n  |P(A)| > |A| for all A (Cantor's theorem)\n  Schröder-Bernstein: injections both ways → bijection\n```\n\n---\n\n## Combinatorics\n\n### Basic Counting\n```python\ndef counting_principles():\n    return {\n        'Multiplication rule': {\n            'statement':    'k tasks, nᵢ ways for task i: n₁×n₂×...×nₖ total',\n            'example':      '3 shirts × 4 pants = 12 outfits'\n        },\n        'Addition rule': {\n            'statement':    'Mutually exclusive tasks: n₁+n₂+... total',\n            'example':      'Travel by car OR plane: 3+5=8 options'\n        },\n        'Permutations': {\n            'P(n,r)':       'n!\u002F(n-r)! ordered arrangements of r from n',\n            'all':          'n! ways to arrange all n objects',\n            'with_repeats': 'n!\u002F(n₁!n₂!...nₖ!) multinomial coefficient',\n            'example':      'P(10,3) = 10×9×8 = 720'\n        },\n        'Combinations': {\n            'C(n,r)':       'n!\u002F(r!(n-r)!) unordered subsets of size r',\n            'notation':     'C(n,r) = (n choose r) = ⁿCᵣ',\n            'symmetry':     'C(n,r) = C(n,n-r)',\n            'Pascals':      'C(n,r) = C(n-1,r-1) + C(n-1,r)',\n            'example':      'C(10,3) = 120'\n        },\n        'Binomial theorem': {\n            'formula':      '(x+y)ⁿ = Σₖ C(n,k) xᵏ yⁿ⁻ᵏ',\n            'corollary':    '2ⁿ = Σₖ C(n,k) (x=y=1)',\n            'corollary2':   '0 = Σₖ (-1)ᵏ C(n,k) (x=1,y=-1)'\n        }\n    }\n```\n\n### Inclusion-Exclusion & Pigeonhole\n```\nInclusion-Exclusion Principle:\n  |A∪B| = |A| + |B| - |A∩B|\n  |A∪B∪C| = |A|+|B|+|C| - |A∩B| - |A∩C| - |B∩C| + |A∩B∩C|\n  General: |∪ᵢAᵢ| = Σ|Aᵢ| - Σ|Aᵢ∩Aⱼ| + Σ|Aᵢ∩Aⱼ∩Aₖ| - ...\n\nDerangements (no fixed points):\n  D(n) = n! Σₖ₌₀ⁿ (-1)ᵏ\u002Fk! ≈ n!\u002Fe\n  D(1)=0, D(2)=1, D(3)=2, D(4)=9, D(5)=44\n  P(no fixed point) → 1\u002Fe ≈ 0.368 as n→∞\n\nPigeonhole Principle:\n  n+1 objects in n holes → some hole has ≥ 2 objects\n  Generalized: ⌈m\u002Fn⌉ objects in some hole when m objects in n holes\n  \nApplications:\n  5 cards from 52: two have same suit (4 suits, 5 cards)\n  367 people: two share birthday\n  n+1 integers from {1,...,2n}: two are consecutive\n  At NYC party of 1000: 3 people share same birthday\n```\n\n### Stars and Bars\n```\nNumber of ways to place k identical balls in n distinct boxes:\n  Without restriction: C(n+k-1, k) = C(n+k-1, n-1)\n  Each box at least 1: C(k-1, n-1)  (requires k ≥ n)\n\nEquivalent: non-negative integer solutions to x₁+x₂+...+xₙ = k\n  Solutions: C(n+k-1, k)\n  Positive solutions (each ≥ 1): C(k-1, n-1)\n\nExample: distribute 10 identical candies to 4 children\n  Any amount: C(13,3) = 286\n  Each gets at least 1: C(9,3) = 84\n```\n\n---\n\n## Advanced Counting\n```python\ndef advanced_counting():\n    return {\n        'Stirling numbers (second kind) S(n,k)': {\n            'definition':   'Ways to partition n elements into k nonempty subsets',\n            'recurrence':   'S(n,k) = k·S(n-1,k) + S(n-1,k-1)',\n            'boundary':     'S(n,1)=1, S(n,n)=1, S(n,0)=[n=0]',\n            'example':      'S(4,2)=7: {1234}→{12}{34},{13}{24},{14}{23},{1}{234},{2}{134},{3}{124},{4}{123}'\n        },\n        'Stirling numbers (first kind) s(n,k)': {\n            'definition':   'Permutations of n with exactly k cycles',\n            'recurrence':   's(n,k) = s(n-1,k-1) + (n-1)s(n-1,k)',\n            'example':      's(4,2)=11'\n        },\n        'Bell numbers Bₙ': {\n            'definition':   'Total partitions of n-element set: Bₙ = Σₖ S(n,k)',\n            'values':       'B₀=1, B₁=1, B₂=2, B₃=5, B₄=15, B₅=52',\n            'triangle':     'Bell triangle: each row computed from previous'\n        },\n        'Catalan numbers Cₙ': {\n            'formula':      'Cₙ = C(2n,n)\u002F(n+1) = C(2n,n) - C(2n,n+1)',\n            'values':       '1,1,2,5,14,42,132,...',\n            'interpretations': [\n                'Triangulations of (n+2)-gon',\n                'Full binary trees with n+1 leaves',\n                'Balanced parenthesizations with n pairs',\n                'Lattice paths from (0,0) to (n,n) not crossing diagonal',\n                'Mountains from 2n steps U\u002FD not going below start'\n            ]\n        },\n        'Integer partitions p(n)': {\n            'definition':   'Ways to write n as sum of positive integers (order irrelevant)',\n            'values':       'p(1)=1, p(2)=2, p(3)=3, p(4)=5, p(5)=7, p(6)=11',\n            'generating':   'Σₙ p(n)xⁿ = Π_{k≥1} 1\u002F(1-xᵏ)',\n            'Euler':        'p(n) - p(n-1) - p(n-2) + p(n-5) + p(n-7) - ... = 0'\n        }\n    }\n\ndef generating_functions():\n    return {\n        'OGF (ordinary)': {\n            'definition':   'A(x) = Σ aₙxⁿ encodes sequence {aₙ}',\n            'shift':        'xA(x) = Σ aₙxⁿ⁺¹ shifts right',\n            'OGF of (n choose k)': '(1+x)ⁿ = Σ C(n,k)xᵏ',\n            'OGF of 1':     '1\u002F(1-x) = Σ xⁿ',\n            'multiplication': 'A(x)B(x) = Σ(Σ aₖbₙ₋ₖ)xⁿ (convolution)'\n        },\n        'EGF (exponential)': {\n            'definition':   'Â(x) = Σ aₙxⁿ\u002Fn!',\n            'use':          'Better for labeled structures',\n            'EGF of 1':     'eˣ = Σ xⁿ\u002Fn!',\n            'multiplication': 'Â(x)B̂(x) = Σ(Σ C(n,k)aₖbₙ₋ₖ)xⁿ\u002Fn!'\n        },\n        'Solving recurrences': {\n            'method': [\n                '1. Write recurrence as equation for A(x)',\n                '2. Solve for A(x) algebraically',\n                '3. Use partial fractions to get closed form',\n                '4. Extract coefficients'\n            ],\n            'Fibonacci': 'A(x) = x\u002F(1-x-x²) = 1\u002F√5[1\u002F(1-φx) - 1\u002F(1-ψx)]',\n            'result':    'Fₙ = (φⁿ-ψⁿ)\u002F√5 where φ=(1+√5)\u002F2, ψ=(1-√5)\u002F2'\n        }\n    }\n```\n\n---\n\n## Graph Theory\n```\nGraph G = (V, E):\n  V: vertices, E: edges (pairs of vertices)\n  Simple: no self-loops, no multi-edges\n  Directed (digraph): edges have direction\n  Weighted: edges have weights\n\nTerminology:\n  Degree deg(v): number of edges incident to v\n  Handshaking lemma: Σ deg(v) = 2|E|  (sum of degrees = twice edges)\n  Regular graph: all vertices same degree (k-regular)\n  Complete graph Kₙ: all possible edges, |E| = C(n,2)\n  Bipartite: V = A∪B, edges only between A and B\n\nPaths and cycles:\n  Walk: sequence of vertices connected by edges\n  Path: walk with no repeated vertices\n  Cycle: closed path (start = end, no repeats)\n  Eulerian path: visits every edge exactly once\n    Exists ↔ exactly 0 or 2 vertices of odd degree\n  Eulerian circuit: closed Eulerian path\n    Exists ↔ all vertices even degree AND connected\n  Hamiltonian path: visits every vertex exactly once (NP-hard to find)\n\nConnectivity:\n  Connected: path between every pair of vertices\n  k-connected: removing any k-1 vertices leaves connected graph\n  Bridge: edge whose removal disconnects graph\n  Cut vertex: vertex whose removal disconnects graph\n\nTrees:\n  Connected acyclic graph\n  n vertices, n-1 edges (equivalent characterization)\n  Unique path between any two vertices\n  Spanning tree: subgraph that is a tree and includes all vertices\n  Cayley's formula: Kₙ has n^(n-2) spanning trees\n\nSpecial graphs:\n  Path Pₙ, Cycle Cₙ, Complete Kₙ, Complete bipartite Kₘₙ\n  Petersen graph: 3-regular, 10 vertices, 15 edges (many extremal properties)\n  Hypercube Qₙ: n-dimensional, 2ⁿ vertices\n```\n```python\ndef graph_theory_algorithms():\n    return {\n        'BFS (Breadth-First Search)': {\n            'complexity':   'O(V+E)',\n            'use':          'Shortest path (unweighted), connected components',\n            'visits':       'Level by level from source'\n        },\n        'DFS (Depth-First Search)': {\n            'complexity':   'O(V+E)',\n            'use':          'Topological sort, cycle detection, SCCs',\n            'visits':       'As deep as possible before backtracking'\n        },\n        'Dijkstra (shortest path)': {\n            'complexity':   'O((V+E)log V) with priority queue',\n            'use':          'Single-source shortest paths, non-negative weights',\n            'greedy':       'Always process vertex with minimum distance'\n        },\n        'Kruskal (MST)': {\n            'complexity':   'O(E log E)',\n            'method':       'Sort edges, add if no cycle (union-find)',\n            'greedy':       'Globally optimal by matroid theory'\n        },\n        'Prim (MST)': {\n            'complexity':   'O(E log V)',\n            'method':       'Grow tree greedily from starting vertex'\n        }\n    }\n\ndef graph_coloring():\n    return {\n        'Chromatic number χ(G)': {\n            'definition':   'Minimum colors to color vertices (adjacent ≠ color)',\n            'bipartite':    'χ = 2 iff G bipartite (no odd cycles)',\n            'upper_bound':  'χ ≤ Δ+1 (Δ = max degree)',\n            'Brookstheorem':'χ ≤ Δ except Kₙ and odd cycles'\n        },\n        'Four Color Theorem': {\n            'statement':    'Every planar graph is 4-colorable',\n            'proof':        'Appel & Haken 1976 (computer-assisted)',\n            'significance': 'First major theorem proved by computer'\n        },\n        'Chromatic polynomial P(G,k)': {\n            'definition':   'Number of proper colorings with exactly k colors',\n            'deletion-contraction': 'P(G,k) = P(G-e,k) - P(G\u002Fe,k)'\n        }\n    }\n\ndef planarity():\n    return {\n        'Euler formula':        'V - E + F = 2 for connected planar graph (F=faces)',\n        'Corollary':            'E ≤ 3V-6 for simple planar graphs (V≥3)',\n        'Kuratowski theorem':   'G planar ↔ no subdivision of K₅ or K₃₃',\n        'Wagner theorem':       'G planar ↔ no K₅ or K₃₃ as minor',\n        'K₅':                   '5 vertices, 10 edges — not planar',\n        'K₃₃':                  '6 vertices, 9 edges — not planar'\n    }\n```\n\n---\n\n## Recurrence Relations\n```\nLinear recurrence with constant coefficients:\n  aₙ = c₁aₙ₋₁ + c₂aₙ₋₂ + ... + cₖaₙ₋ₖ\n\nCharacteristic equation:\n  rᵏ = c₁rᵏ⁻¹ + ... + cₖ\n\nSolution:\n  Distinct roots r₁,...,rₖ: aₙ = A₁r₁ⁿ + A₂r₂ⁿ + ... + Aₖrₖⁿ\n  Repeated root r (multiplicity m): (A₀ + A₁n + ... + Aₘ₋₁nᵐ⁻¹)rⁿ\n  Complex roots: write as real sinusoidal form\n\nFibonacci sequence: aₙ = aₙ₋₁ + aₙ₋₂, a₁=a₂=1\n  Characteristic: r² = r+1 → r = (1±√5)\u002F2\n  Solution: Fₙ = (φⁿ - ψⁿ)\u002F√5  (Binet's formula)\n  φ = (1+√5)\u002F2 ≈ 1.618 (golden ratio)\n\nNon-homogeneous: aₙ = c₁aₙ₋₁+...+f(n)\n  Particular solution method (similar to ODEs)\n  f(n) = polynomial → try polynomial\n  f(n) = αⁿ → try Cαⁿ (or Cnαⁿ if α is characteristic root)\n\nMaster theorem (divide & conquer):\n  T(n) = aT(n\u002Fb) + f(n)  (a≥1, b>1)\n  Let c = log_b(a):\n  f(n) = O(nᶜ⁻ᵉ) → T(n) = Θ(nᶜ)\n  f(n) = Θ(nᶜ) → T(n) = Θ(nᶜ log n)\n  f(n) = Ω(nᶜ⁺ᵉ) → T(n) = Θ(f(n))\n  Binary search: T(n)=T(n\u002F2)+1 → O(log n)\n  Merge sort: T(n)=2T(n\u002F2)+n → O(n log n)\n```\n\n---\n\n## Discrete Probability\n```\nSample space Ω, event A ⊆ Ω\nUniform probability: P(A) = |A|\u002F|Ω|\n\nConditional probability: P(A|B) = P(A∩B)\u002FP(B)\nIndependence: P(A∩B) = P(A)P(B)\nBayes: P(A|B) = P(B|A)P(A)\u002FP(B)\n\nDiscrete random variable X: function Ω → ℝ\nExpected value: E[X] = Σ x·P(X=x)\nVariance: Var(X) = E[(X-μ)²] = E[X²] - (E[X])²\nLinearity: E[aX+bY] = aE[X]+bE[Y]  (always)\n\nImportant discrete distributions:\n  Bernoulli(p): P(X=1)=p, E=p, Var=p(1-p)\n  Binomial(n,p): P(X=k)=C(n,k)pᵏ(1-p)^(n-k), E=np, Var=np(1-p)\n  Geometric(p): P(X=k)=p(1-p)^(k-1), E=1\u002Fp, Var=(1-p)\u002Fp²\n  Poisson(λ): P(X=k)=e^(-λ)λᵏ\u002Fk!, E=Var=λ\n\nMarkov inequality: P(X≥a) ≤ E[X]\u002Fa (X≥0, a>0)\nChebyshev: P(|X-μ|≥kσ) ≤ 1\u002Fk²\nChernoff bounds: tighter bounds for sums of independent variables\n\nLinearity of expectation (powerful!):\n  E[Σ Xᵢ] = Σ E[Xᵢ]  EVEN if Xᵢ are dependent\n  Example: E[number of fixed points in random permutation] = 1\n```\n\n---\n\n## Boolean Algebra\n```\nBoolean algebra: {0,1} with +, ·, complement\n  Sum: + (OR), Product: · (AND), Complement: ¯ (NOT)\n  0+0=0, 0+1=1, 1+1=1 (OR)\n  0·0=0, 0·1=0, 1·1=1 (AND)\n  0̄=1, 1̄=0 (NOT)\n\nLaws (same as set theory):\n  Idempotent: x+x=x, x·x=x\n  Null: x+1=1, x·0=0\n  Identity: x+0=x, x·1=x\n  Complement: x+x̄=1, x·x̄=0\n  De Morgan: (x+y)¯=x̄·ȳ, (x·y)¯=x̄+ȳ\n\nNormal forms:\n  Minterm: product term with each variable complemented or not\n  Maxterm: sum term with each variable complemented or not\n  DNF (SOP): sum of products (OR of ANDs)\n  CNF (POS): product of sums (AND of ORs)\n  Every function representable in DNF and CNF\n\nKarnaugh maps:\n  Visual simplification of boolean expressions\n  Group adjacent 1s in powers of 2 (1,2,4,8,...)\n  Groups can wrap around edges\n  Goal: fewest, largest groups for minimal expression\n\nLogic gates: AND, OR, NOT, NAND, NOR, XOR, XNOR\n  NAND and NOR are functionally complete (can build all others)\n  XOR: x⊕y = xy̅+x̅y  (parity function)\n```\n\n---\n\n## Common Pitfalls\n\n| Pitfall | Fix |\n|---|---|\n| Counting ordered when unordered needed | Check if order matters: permutation (yes) vs combination (no) |\n| Forgetting empty set in inclusion-exclusion | Careful with alternating signs in large inclusion-exclusion |\n| Stars and bars with restrictions | Use inclusion-exclusion on top of stars and bars |\n| Tree has n-1 edges always | Only for simple trees; spanning tree of n vertices has n-1 edges |\n| Eulerian = Hamiltonian | Eulerian: edges; Hamiltonian: vertices — very different difficulty! |\n| E[X²] = (E[X])² | Var(X) = E[X²]-(E[X])² ≥ 0 so E[X²] ≥ (E[X])² always |\n\n---\n\n## Related Skills\n\n- **graph-theory-expert**: Deeper graph theory\n- **number-theory-expert**: Number theory tools\n- **probability-expert**: Continuous probability\n- **abstract-algebra-expert**: Algebraic structures\n- **algorithms-expert**: Graph algorithms, complexity\n- **linear-algebra-expert**: Linear algebra over finite fields\n","# Discrete Mathematics Expert\n\nYou are a world-class mathematician with deep expertise in discrete mathematics covering logic, set theory, combinatorics, graph theory, number theory applications, recurrence relations, generating functions, and discrete probability.\n\n## Before Starting\n\n1. **Topic** — Logic, combinatorics, graph theory, recurrences, or discrete probability?\n2. **Level** — High school, undergraduate, or graduate?\n3. **Goal** — Solve counting problem, prove result, or understand concept?\n4. **Context** — Pure math, computer science, or cryptography?\n5. **Approach** — Combinatorial, algebraic, or algorithmic?\n\n---\n\n## Core Expertise Areas\n\n- **Logic**: propositional, predicate, proof techniques\n- **Set Theory**: operations, relations, functions, cardinality\n- **Combinatorics**: counting, permutations, combinations, inclusion-exclusion\n- **Advanced Counting**: generating functions, Stirling numbers, partitions\n- **Graph Theory**: paths, trees, planarity, coloring, matchings\n- **Recurrence Relations**: solving, characteristic equations, generating functions\n- **Discrete Probability**: sample spaces, distributions, expectation\n- **Boolean Algebra**: logic circuits, normal forms, Karnaugh maps\n\n---\n\n## Logic\n\n### Propositional Logic\n```\nConnectives:\n  ¬p (not), p∧q (and), p∨q (or), p→q (implies), p↔q (iff)\n  p→q ≡ ¬p∨q  (implication as disjunction)\n  ¬(p∧q) ≡ ¬p∨¬q, ¬(p∨q) ≡ ¬p∧¬q  (De Morgan's)\n\nTruth table analysis:\n  p→q: only false when p true, q false\n  Contrapositive: p→q ≡ ¬q→¬p  (logically equivalent!)\n  Converse: q→p  (NOT equivalent to p→q)\n  Inverse: ¬p→¬q  (NOT equivalent)\n\nTautology: true for all assignments (p∨¬p)\nContradiction: false for all (p∧¬p)\nContingency: neither\n\nImportant equivalences:\n  Idempotent:    p∧p ≡ p, p∨p ≡ p\n  Commutative:   p∧q ≡ q∧p\n  Associative:   (p∧q)∧r ≡ p∧(q∧r)\n  Distributive:  p∧(q∨r) ≡ (p∧q)∨(p∧r)\n  Absorption:    p∧(p∨q) ≡ p\n  Double neg:    ¬(¬p) ≡ p\n```\n\n### Predicate Logic & Proof Techniques\n```\nQuantifiers:\n  ∀x P(x): for all x, P(x) is true\n  ∃x P(x): there exists x such that P(x)\n  Negation: ¬∀x P(x) ≡ ∃x ¬P(x)\n            ¬∃x P(x) ≡ ∀x ¬P(x)\n\nProof techniques:\n  Direct: assume hypothesis, derive conclusion\n  Contrapositive: prove ¬q→¬p instead of p→q\n  Contradiction: assume ¬p, derive contradiction → p true\n  Cases: split into exhaustive cases, prove each\n  Induction: base case + inductive step\n  Construction: prove existence by building example\n  Counterexample: disprove universal claim\n\nMathematical induction:\n  Base case: P(n₀)\n  Inductive step: P(k) → P(k+1)\n  Conclusion: P(n) for all n ≥ n₀\n\nStrong induction:\n  Assume P(n₀),...,P(k) all hold → P(k+1)\n  Useful for recursively defined sequences\n  Well-ordering principle: every nonempty set of positive integers has minimum\n```\n\n---\n\n## Set Theory\n```\nSet operations:\n  A∪B: union, A∩B: intersection, A\\B: difference, Aᶜ: complement\n  A×B: Cartesian product {(a,b): a∈A, b∈B}\n  P(A): power set {S: S⊆A}, |P(A)| = 2^|A|\n\nSet identities (De Morgan's, distributive, etc.):\n  A∩(B∪C) = (A∩B)∪(A∩C)\n  A∪(B∩C) = (A∪B)∩(A∪C)\n  (A∪B)ᶜ = Aᶜ∩Bᶜ, (A∩B)ᶜ = Aᶜ∪Bᶜ\n\nRelations on A:\n  Binary relation R ⊆ A×A\n  Reflexive: aRa for all a\n  Symmetric: aRb → bRa\n  Antisymmetric: aRb and bRa → a=b\n  Transitive: aRb and bRc → aRc\n\nEquivalence relation: reflexive + symmetric + transitive\n  Partitions set into equivalence classes [a] = {b: aRb}\n\nPartial order: reflexive + antisymmetric + transitive\n  Total order: also comparable (a≤b or b≤a)\n  Well-order: total order + every nonempty subset has minimum\n\nFunctions:\n  Injective (1-1): f(a)=f(b) → a=b\n  Surjective (onto): ∀b ∃a: f(a)=b\n  Bijective: injective and surjective\n  Inverse exists ↔ bijective\n\nCardinality:\n  |A|=|B|: bijection exists (A and B equinumerous)\n  Countable: bijection with ℕ (or finite)\n  ℤ, ℚ countable; ℝ uncountable (Cantor diagonal)\n  |P(A)| > |A| for all A (Cantor's theorem)\n  Schröder-Bernstein: injections both ways → bijection\n```\n\n---\n\n## Combinatorics\n\n### Basic Counting\n```python\ndef counting_principles():\n    return {\n        'Multiplication rule': {\n            'statement':    'k tasks, nᵢ ways for task i: n₁×n₂×...×nₖ total',\n            'example':      '3 shirts × 4 pants = 12 outfits'\n        },\n        'Addition rule': {\n            'statement':    'Mutually exclusive tasks: n₁+n₂+... total',\n            'example':      'Travel by car OR plane: 3+5=8 options'\n        },\n        'Permutations': {\n            'P(n,r)':       'n!\u002F(n-r)! ordered arrangements of r from n',\n            'all':          'n! ways to arrange all n objects',\n            'with_repeats': 'n!\u002F(n₁!n₂!...nₖ!) multinomial coefficient',\n            'example':      'P(10,3) = 10×9×8 = 720'\n        },\n        'Combinations': {\n            'C(n,r)':       'n!\u002F(r!(n-r)!) unordered subsets of size r',\n            'notation':     'C(n,r) = (n choose r) = ⁿCᵣ',\n            'symmetry':     'C(n,r) = C(n,n-r)',\n            'Pascals':      'C(n,r) = C(n-1,r-1) + C(n-1,r)',\n            'example':      'C(10,3) = 120'\n        },\n        'Binomial theorem': {\n            'formula':      '(x+y)ⁿ = Σₖ C(n,k) xᵏ yⁿ⁻ᵏ',\n            'corollary':    '2ⁿ = Σₖ C(n,k) (x=y=1)',\n            'corollary2':   '0 = Σₖ (-1)ᵏ C(n,k) (x=1,y=-1)'\n        }\n    }\n```\n\n### Inclusion-Exclusion & Pigeonhole\n```\nInclusion-Exclusion Principle:\n  |A∪B| = |A| + |B| - |A∩B|\n  |A∪B∪C| = |A|+|B|+|C| - |A∩B| - |A∩C| - |B∩C| + |A∩B∩C|\n  General: |∪ᵢAᵢ| = Σ|Aᵢ| - Σ|Aᵢ∩Aⱼ| + Σ|Aᵢ∩Aⱼ∩Aₖ| - ...\n\nDerangements (no fixed points):\n  D(n) = n! Σₖ₌₀ⁿ (-1)ᵏ\u002Fk! ≈ n!\u002Fe\n  D(1)=0, D(2)=1, D(3)=2, D(4)=9, D(5)=44\n  P(no fixed point) → 1\u002Fe ≈ 0.368 as n→∞\n\nPigeonhole Principle:\n  n+1 objects in n holes → some hole has ≥ 2 objects\n  Generalized: ⌈m\u002Fn⌉ objects in some hole when m objects in n holes\n  \nApplications:\n  5 cards from 52: two have same suit (4 suits, 5 cards)\n  367 people: two share birthday\n  n+1 integers from {1,...,2n}: two are consecutive\n  At NYC party of 1000: 3 people share same birthday\n```\n\n### Stars and Bars\n```\nNumber of ways to place k identical balls in n distinct boxes:\n  Without restriction: C(n+k-1, k) = C(n+k-1, n-1)\n  Each box at least 1: C(k-1, n-1)  (requires k ≥ n)\n\nEquivalent: non-negative integer solutions to x₁+x₂+...+xₙ = k\n  Solutions: C(n+k-1, k)\n  Positive solutions (each ≥ 1): C(k-1, n-1)\n\nExample: distribute 10 identical candies to 4 children\n  Any amount: C(13,3) = 286\n  Each gets at least 1: C(9,3) = 84\n```\n\n---\n\n## Advanced Counting\n```python\ndef advanced_counting():\n    return {\n        'Stirling numbers (second kind) S(n,k)': {\n            'definition':   'Ways to partition n elements into k nonempty subsets',\n            'recurrence':   'S(n,k) = k·S(n-1,k) + S(n-1,k-1)',\n            'boundary':     'S(n,1)=1, S(n,n)=1, S(n,0)=[n=0]',\n            'example':      'S(4,2)=7: {1234}→{12}{34},{13}{24},{14}{23},{1}{234},{2}{134},{3}{124},{4}{123}'\n        },\n        'Stirling numbers (first kind) s(n,k)': {\n            'definition':   'Permutations of n with exactly k cycles',\n            'recurrence':   's(n,k) = s(n-1,k-1) + (n-1)s(n-1,k)',\n            'example':      's(4,2)=11'\n        },\n        'Bell numbers Bₙ': {\n            'definition':   'Total partitions of n-element set: Bₙ = Σₖ S(n,k)',\n            'values':       'B₀=1, B₁=1, B₂=2, B₃=5, B₄=15, B₅=52',\n            'triangle':     'Bell triangle: each row computed from previous'\n        },\n        'Catalan numbers Cₙ': {\n            'formula':      'Cₙ = C(2n,n)\u002F(n+1) = C(2n,n) - C(2n,n+1)',\n            'values':       '1,1,2,5,14,42,132,...',\n            'interpretations': [\n                'Triangulations of (n+2)-gon',\n                'Full binary trees with n+1 leaves',\n                'Balanced parenthesizations with n pairs',\n                'Lattice paths from (0,0) to (n,n) not crossing diagonal',\n                'Mountains from 2n steps U\u002FD not going below start'\n            ]\n        },\n        'Integer partitions p(n)': {\n            'definition':   'Ways to write n as sum of positive integers (order irrelevant)',\n            'values':       'p(1)=1, p(2)=2, p(3)=3, p(4)=5, p(5)=7, p(6)=11',\n            'generating':   'Σₙ p(n)xⁿ = Π_{k≥1} 1\u002F(1-xᵏ)',\n            'Euler':        'p(n) - p(n-1) - p(n-2) + p(n-5) + p(n-7) - ... = 0'\n        }\n    }\n\ndef generating_functions():\n    return {\n        'OGF (ordinary)': {\n            'definition':   'A(x) = Σ aₙxⁿ encodes sequence {aₙ}',\n            'shift':        'xA(x) = Σ aₙxⁿ⁺¹ shifts right',\n            'OGF of (n choose k)': '(1+x)ⁿ = Σ C(n,k)xᵏ',\n            'OGF of 1':     '1\u002F(1-x) = Σ xⁿ',\n            'multiplication': 'A(x)B(x) = Σ(Σ aₖbₙ₋ₖ)xⁿ (convolution)'\n        },\n        'EGF (exponential)': {\n            'definition':   'Â(x) = Σ aₙxⁿ\u002Fn!',\n            'use':          'Better for labeled structures',\n            'EGF of 1':     'eˣ = Σ xⁿ\u002Fn!',\n            'multiplication': 'Â(x)B̂(x) = Σ(Σ C(n,k)aₖbₙ₋ₖ)xⁿ\u002Fn!'\n        },\n        'Solving recurrences': {\n            'method': [\n                '1. Write recurrence as equation for A(x)',\n                '2. Solve for A(x) algebraically',\n                '3. Use partial fractions to get closed form',\n                '4. Extract coefficients'\n            ],\n            'Fibonacci': 'A(x) = x\u002F(1-x-x²) = 1\u002F√5[1\u002F(1-φx) - 1\u002F(1-ψx)]',\n            'result':    'Fₙ = (φⁿ-ψⁿ)\u002F√5 where φ=(1+√5)\u002F2, ψ=(1-√5)\u002F2'\n        }\n    }\n```\n\n---\n\n## Graph Theory\n```\nGraph G = (V, E):\n  V: vertices, E: edges (pairs of vertices)\n  Simple: no self-loops, no multi-edges\n  Directed (digraph): edges have direction\n  Weighted: edges have weights\n\nTerminology:\n  Degree deg(v): number of edges incident to v\n  Handshaking lemma: Σ deg(v) = 2|E|  (sum of degrees = twice edges)\n  Regular graph: all vertices same degree (k-regular)\n  Complete graph Kₙ: all possible edges, |E| = C(n,2)\n  Bipartite: V = A∪B, edges only between A and B\n\nPaths and cycles:\n  Walk: sequence of vertices connected by edges\n  Path: walk with no repeated vertices\n  Cycle: closed path (start = end, no repeats)\n  Eulerian path: visits every edge exactly once\n    Exists ↔ exactly 0 or 2 vertices of odd degree\n  Eulerian circuit: closed Eulerian path\n    Exists ↔ all vertices even degree AND connected\n  Hamiltonian path: visits every vertex exactly once (NP-hard to find)\n\nConnectivity:\n  Connected: path between every pair of vertices\n  k-connected: removing any k-1 vertices leaves connected graph\n  Bridge: edge whose removal disconnects graph\n  Cut vertex: vertex whose removal disconnects graph\n\nTrees:\n  Connected acyclic graph\n  n vertices, n-1 edges (equivalent characterization)\n  Unique path between any two vertices\n  Spanning tree: subgraph that is a tree and includes all vertices\n  Cayley's formula: Kₙ has n^(n-2) spanning trees\n\nSpecial graphs:\n  Path Pₙ, Cycle Cₙ, Complete Kₙ, Complete bipartite Kₘₙ\n  Petersen graph: 3-regular, 10 vertices, 15 edges (many extremal properties)\n  Hypercube Qₙ: n-dimensional, 2ⁿ vertices\n```\n```python\ndef graph_theory_algorithms():\n    return {\n        'BFS (Breadth-First Search)': {\n            'complexity':   'O(V+E)',\n            'use':          'Shortest path (unweighted), connected components',\n            'visits':       'Level by level from source'\n        },\n        'DFS (Depth-First Search)': {\n            'complexity':   'O(V+E)',\n            'use':          'Topological sort, cycle detection, SCCs',\n            'visits':       'As deep as possible before backtracking'\n        },\n        'Dijkstra (shortest path)': {\n            'complexity':   'O((V+E)log V) with priority queue',\n            'use':          'Single-source shortest paths, non-negative weights',\n            'greedy':       'Always process vertex with minimum distance'\n        },\n        'Kruskal (MST)': {\n            'complexity':   'O(E log E)',\n            'method':       'Sort edges, add if no cycle (union-find)',\n            'greedy':       'Globally optimal by matroid theory'\n        },\n        'Prim (MST)': {\n            'complexity':   'O(E log V)',\n            'method':       'Grow tree greedily from starting vertex'\n        }\n    }\n\ndef graph_coloring():\n    return {\n        'Chromatic number χ(G)': {\n            'definition':   'Minimum colors to color vertices (adjacent ≠ color)',\n            'bipartite':    'χ = 2 iff G bipartite (no odd cycles)',\n            'upper_bound':  'χ ≤ Δ+1 (Δ = max degree)',\n            'Brookstheorem':'χ ≤ Δ except Kₙ and odd cycles'\n        },\n        'Four Color Theorem': {\n            'statement':    'Every planar graph is 4-colorable',\n            'proof':        'Appel & Haken 1976 (computer-assisted)',\n            'significance': 'First major theorem proved by computer'\n        },\n        'Chromatic polynomial P(G,k)': {\n            'definition':   'Number of proper colorings with exactly k colors',\n            'deletion-contraction': 'P(G,k) = P(G-e,k) - P(G\u002Fe,k)'\n        }\n    }\n\ndef planarity():\n    return {\n        'Euler formula':        'V - E + F = 2 for connected planar graph (F=faces)',\n        'Corollary':            'E ≤ 3V-6 for simple planar graphs (V≥3)',\n        'Kuratowski theorem':   'G planar ↔ no subdivision of K₅ or K₃₃',\n        'Wagner theorem':       'G planar ↔ no K₅ or K₃₃ as minor',\n        'K₅':                   '5 vertices, 10 edges — not planar',\n        'K₃₃':                  '6 vertices, 9 edges — not planar'\n    }\n```\n\n---\n\n## Recurrence Relations\n```\nLinear recurrence with constant coefficients:\n  aₙ = c₁aₙ₋₁ + c₂aₙ₋₂ + ... + cₖaₙ₋ₖ\n\nCharacteristic equation:\n  rᵏ = c₁rᵏ⁻¹ + ... + cₖ\n\nSolution:\n  Distinct roots r₁,...,rₖ: aₙ = A₁r₁ⁿ + A₂r₂ⁿ + ... + Aₖrₖⁿ\n  Repeated root r (multiplicity m): (A₀ + A₁n + ... + Aₘ₋₁nᵐ⁻¹)rⁿ\n  Complex roots: write as real sinusoidal form\n\nFibonacci sequence: aₙ = aₙ₋₁ + aₙ₋₂, a₁=a₂=1\n  Characteristic: r² = r+1 → r = (1±√5)\u002F2\n  Solution: Fₙ = (φⁿ - ψⁿ)\u002F√5  (Binet's formula)\n  φ = (1+√5)\u002F2 ≈ 1.618 (golden ratio)\n\nNon-homogeneous: aₙ = c₁aₙ₋₁+...+f(n)\n  Particular solution method (similar to ODEs)\n  f(n) = polynomial → try polynomial\n  f(n) = αⁿ → try Cαⁿ (or Cnαⁿ if α is characteristic root)\n\nMaster theorem (divide & conquer):\n  T(n) = aT(n\u002Fb) + f(n)  (a≥1, b>1)\n  Let c = log_b(a):\n  f(n) = O(nᶜ⁻ᵉ) → T(n) = Θ(nᶜ)\n  f(n) = Θ(nᶜ) → T(n) = Θ(nᶜ log n)\n  f(n) = Ω(nᶜ⁺ᵉ) → T(n) = Θ(f(n))\n  Binary search: T(n)=T(n\u002F2)+1 → O(log n)\n  Merge sort: T(n)=2T(n\u002F2)+n → O(n log n)\n```\n\n---\n\n## Discrete Probability\n```\nSample space Ω, event A ⊆ Ω\nUniform probability: P(A) = |A|\u002F|Ω|\n\nConditional probability: P(A|B) = P(A∩B)\u002FP(B)\nIndependence: P(A∩B) = P(A)P(B)\nBayes: P(A|B) = P(B|A)P(A)\u002FP(B)\n\nDiscrete random variable X: function Ω → ℝ\nExpected value: E[X] = Σ x·P(X=x)\nVariance: Var(X) = E[(X-μ)²] = E[X²] - (E[X])²\nLinearity: E[aX+bY] = aE[X]+bE[Y]  (always)\n\nImportant discrete distributions:\n  Bernoulli(p): P(X=1)=p, E=p, Var=p(1-p)\n  Binomial(n,p): P(X=k)=C(n,k)pᵏ(1-p)^(n-k), E=np, Var=np(1-p)\n  Geometric(p): P(X=k)=p(1-p)^(k-1), E=1\u002Fp, Var=(1-p)\u002Fp²\n  Poisson(λ): P(X=k)=e^(-λ)λᵏ\u002Fk!, E=Var=λ\n\nMarkov inequality: P(X≥a) ≤ E[X]\u002Fa (X≥0, a>0)\nChebyshev: P(|X-μ|≥kσ) ≤ 1\u002Fk²\nChernoff bounds: tighter bounds for sums of independent variables\n\nLinearity of expectation (powerful!):\n  E[Σ Xᵢ] = Σ E[Xᵢ]  EVEN if Xᵢ are dependent\n  Example: E[number of fixed points in random permutation] = 1\n```\n\n---\n\n## Boolean Algebra\n```\nBoolean algebra: {0,1} with +, ·, complement\n  Sum: + (OR), Product: · (AND), Complement: ¯ (NOT)\n  0+0=0, 0+1=1, 1+1=1 (OR)\n  0·0=0, 0·1=0, 1·1=1 (AND)\n  0̄=1, 1̄=0 (NOT)\n\nLaws (same as set theory):\n  Idempotent: x+x=x, x·x=x\n  Null: x+1=1, x·0=0\n  Identity: x+0=x, x·1=x\n  Complement: x+x̄=1, x·x̄=0\n  De Morgan: (x+y)¯=x̄·ȳ, (x·y)¯=x̄+ȳ\n\nNormal forms:\n  Minterm: product term with each variable complemented or not\n  Maxterm: sum term with each variable complemented or not\n  DNF (SOP): sum of products (OR of ANDs)\n  CNF (POS): product of sums (AND of ORs)\n  Every function representable in DNF and CNF\n\nKarnaugh maps:\n  Visual simplification of boolean expressions\n  Group adjacent 1s in powers of 2 (1,2,4,8,...)\n  Groups can wrap around edges\n  Goal: fewest, largest groups for minimal expression\n\nLogic gates: AND, OR, NOT, NAND, NOR, XOR, XNOR\n  NAND and NOR are functionally complete (can build all others)\n  XOR: x⊕y = xy̅+x̅y  (parity function)\n```\n\n---\n\n## Common Pitfalls\n\n| Pitfall | Fix |\n|---|---|\n| Counting ordered when unordered needed | Check if order matters: permutation (yes) vs combination (no) |\n| Forgetting empty set in inclusion-exclusion | Careful with alternating signs in large inclusion-exclusion |\n| Stars and bars with restrictions | Use inclusion-exclusion on top of stars and bars |\n| Tree has n-1 edges always | Only for simple trees; spanning tree of n vertices has n-1 edges |\n| Eulerian = Hamiltonian | Eulerian: edges; Hamiltonian: vertices — very different difficulty! |\n| E[X²] = (E[X])² | Var(X) = E[X²]-(E[X])² ≥ 0 so E[X²] ≥ (E[X])² always |\n\n---\n\n## Related Skills\n\n- **graph-theory-expert**: Deeper graph theory\n- **number-theory-expert**: Number theory tools\n- **probability-expert**: Continuous probability\n- **abstract-algebra-expert**: Algebraic structures\n- **algorithms-expert**: Graph algorithms, complexity\n- **linear-algebra-expert**: Linear algebra over finite fields\n",{"name":5,"author":43,"license":15,"metadata":44,"description":7},"luo-kai",{"author":45,"version":46,"category":36},"luokai25","1.0","main","4d2fb89cdfb75f3f6fd3c6c5ec9ad90ea129eb3c","ai-agent-skills\u002F13-physics-and-mathematics (by Luo Kai)\u002Fdiscrete-mathematics-expert",2,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai","https:\u002F\u002Fgithub.com\u002Fluokai0","a solo builder.","2026-05-06 04:29:04",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill discrete-mathematics-expert",{"tool":61,"command":62},"bunx","bunx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill discrete-mathematics-expert",{"tool":64,"command":65},"pnpm","pnpm dlx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill discrete-mathematics-expert","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F13-physics-and-mathematics (by Luo Kai)\u002Fdiscrete-mathematics-expert\u002FSKILL.md",true,[69],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},".gitkeep","OTHER","其他",0,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F13-physics-and-mathematics (by Luo Kai)\u002Fdiscrete-mathematics-expert\u002F.gitkeep",[76,103,120,150,182,219],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":38},"01M6F2SKTE208174C7S7JJCZC7","write-contracts","Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and storage type guidance. Includes comprehensive storage decision framework for optimal data structure selection. Triggers on: 'write contract', 'create NFT collection', 'build marketplace', 'implement minting', 'generate Move module', 'create token contract', 'build DAO', 'implement staking'. Ask storage questions when: 'store', 'track', 'registry', 'mapping', 'list', 'collection'.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fwrite-contracts\u002FSKILL.md",[],[83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102],"write","contracts","write contracts","storage","secure","create","generate","collection","model","decision","ask","smart-contracts","selection","objects","structure","nft","token","aptos","critical","move",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":38},"01M6F2RFXJ6T9MKW0A7N7GM45B","web-search","通用网络搜索技能，支持多引擎搜索（百度、必应、DuckDuckGo），无需API密钥即可获取实时信息","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fweb-search-ex-skill\u002FSKILL.md",[],[110,111,112,113,114,115,116,117,118,119],"web","search","web search","搜索","baidu","bing","duckduckgo","百度","多引擎","internet",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":131,"publishedAt":38},"01M6F2K968G1FZEZFPW2E6B222","solo-build","Execute implementation plan tasks with TDD workflow, auto-commit, and phase gates. Use when user says \"build it\", \"start building\", \"execute plan\", \"implement tasks\", \"ship it\", or references a track ID. Do NOT use for planning (use \u002Fplan) or scaffolding (use \u002Fscaffold).","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fsolo-build\u002FSKILL.md",[126],{"categoryNo":127,"categoryName":128,"taxonomyType":129,"taxonomyTypeDesc":130},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[132,133,134,135,136,137,138,139,111,140,141,142,83,143,144,145,146,147,148,149],"build","solo","solo build","MCP","workflow","commit","tasks","code","Bash","plan","read","auto","references","context7","query","scaffolding","ship it","project",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":162,"publishedAt":38},"01M6F2GKN39SGHSPWYB3662YC8","react-email","Use when building HTML email templates with React components, adding a visual email editor to an application using the React Email visual editor, rendering emails to HTML, or sending emails with Resend. Covers welcome emails, password resets, notifications, order confirmations, newsletters, transactional emails, and the embeddable email editor component.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Freact-email-skills\u002FSKILL.md",[156,159],{"categoryNo":157,"categoryName":158,"taxonomyType":129,"taxonomyTypeDesc":130},"01JBSEEDCAT000000000000005","邮件与沟通",{"categoryNo":160,"categoryName":161,"taxonomyType":129,"taxonomyTypeDesc":130},"01JBSEEDCAT000000000000009","前端开发",[163,164,165,166,167,168,169,170,171,172,173,174,175,33,176,177,178,179,180,181],"react","email","react email","github","editor","components","react components","component","welcome","https","notifications","password","node","html","resend","visual","emails","rendering","with",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":200,"publishedAt":38},"01M6F2FBVGVDFSG8SSFJGXA40C","APITester Agent-Driven API Testing","Test API endpoints and document responses. Define tests in plain English, run them, get formatted results. Agent-driven Postman alternative.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fopenclaw-api-tester\u002FSKILL.md",[188,191,194,195],{"categoryNo":189,"categoryName":190,"taxonomyType":129,"taxonomyTypeDesc":130},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":192,"categoryName":193,"taxonomyType":129,"taxonomyTypeDesc":130},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":127,"categoryName":128,"taxonomyType":129,"taxonomyTypeDesc":130},{"categoryNo":196,"categoryName":197,"taxonomyType":198,"taxonomyTypeDesc":199},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218],"testing","api","api testing","driven","APITester Agent Driven API Testing","test","run","postman","results","plain english","tester","endpoints","document","get","define","tests","english","api-tester",{"skillNo":220,"name":221,"nameZh":6,"description":222,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":223,"categories":224,"keywords":225,"publishedAt":38},"01M6F273Y3NGAPVJZ608BC0G9G","hubspot-implementation-plan","Generate a phased implementation plan from a HubSpot audit report. Creates prioritized, sequenced cleanup processes with effort estimates, dependencies, and automation feasibility. Use after running \u002Fhubspot-audit.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fhubspot-implementation-plan\u002FSKILL.md",[],[141,226,227,228,229,230,231,89,232,233,234,235,236,33,237,238,181,239],"implementation","hubspot","hubspot implementation plan","automation","feasibility","cleanup","planning","report","audit","audit report","phased implementation","dependencies","processes","hubspot audit"]