Token导航 LogoToken导航TokenDH.com
待分类需要联网github未标认证来源可访问许可证需确认审计通过

tikztikz 命令行

Agent Skill

tikz 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,147

周安装

86

GitHub Stars

4

下载量

695
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tikz(tikz 命令行)
来源仓库:https://github.com/igbuend/grimbard
仓库路径:skills/tikz
安装命令:
npx skills add https://github.com/igbuend/grimbard --skill tikz
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/igbuend/grimbard --skill tikz

简介

用于处理 TikZ 相关的 GitHub 仓库协作信息,适合在文档绘制或技术写作项目中跟踪 Issue 与 PR。

  • 可关联代码变更与讨论事项,协助维护图形脚本或技术图示的更新状态。
  • 通过 GitHub 仓库安装,使用 npx 命令添加技能,建议查阅原始文档了解输入输出格式。
  • 使用前请确认权限范围、仓库维护状态,以及是否会触发文件读写或命令执行。
  • tikz 属于待分类类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

TikZ/PGF — Vector Graphics & Diagrams

CTAN: https://ctan.org/pkg/pgf Manual: texdoc tikz (~1300 pages)

Setup

\usepackage{tikz}
% Load libraries as needed:
\usetikzlibrary{arrows.meta, calc, positioning, decorations.pathmorphing,
  patterns, shapes.geometric, shapes.misc, fit, backgrounds,
  automata, trees, mindmap, circuits.logic.US}

Basic Drawing

Minimal Example

\begin{tikzpicture}
  \draw (0,0) -- (2,0) -- (2,2) -- cycle;  % triangle
\end{tikzpicture}

Path Operations

OperationSyntaxExample
Line--(0,0) -- (1,1)
Horizontal-vertical-\`(0,0) -
Vertical-horizontal\-`(0,0)
Curve.. controls....(0,0).. controls (0.5,1).. (1,0)
Smooth curveto[out=..,in=..](0,0) to[out=90,in=180] (2,1)
Arcarc(0,0) arc (0:90:1cm) start:end:radius
Circlecircle(0,0) circle[radius=1]
Ellipseellipse(0,0) ellipse[x radius=2, y radius=1]
Rectanglerectangle(0,0) rectangle (2,1)
Gridgrid(0,0) grid (3,3)
Parabolaparabola(0,0) parabola (2,2)
Sin/Cossin/cos(0,0) sin (1,1)
Plotplotplot[domain=0:3] (\x, {\x^2})
Cyclecycleclose path back to start

Path Actions

CommandEffect
\drawStroke the path
\fillFill the path
\filldrawFill and stroke
\pathInvisible path (for coordinates, nodes)
\clipClip subsequent drawing to path
\shadeGradient fill
\shadedrawGradient fill + stroke
\nodeShorthand for \path node
\coordinateShorthand for \path coordinate

Common Draw Options

\draw[
  color=blue,            % or just: blue
  line width=1pt,        % or: thin, thick, very thick, ultra thick
  dashed,                % or: dotted, dash dot, dash dot dot
  dash pattern={on 3pt off 2pt},
  rounded corners=5pt,
  ->                     % arrow tip (see arrows section)
  opacity=0.5,
  double,
  double distance=2pt,
] (0,0) -- (2,2);

Common Fill Options

\fill[
  fill=blue!20,          % 20% blue
  fill opacity=0.5,
  pattern=north lines,   % requires patterns library
  pattern color=gray,
] (0,0) rectangle (2,1);

Coordinate Systems

% Cartesian (default)
(2, 3)

% Polar (angle:radius)
(45:2cm)

% Relative (shift from last point)
++(1,0)    % move reference point
+(1,0)     % don't move reference point

% Named
\coordinate (A) at (1,2);
\draw (A) -- (2,3);

% Intersection (calc library)
\usetikzlibrary{calc}
($(A)!0.5!(B)$)           % midpoint of A and B
($(A)!0.5!90:(B)$)        % midpoint rotated 90°
($(A) + (1,2)$)           % A shifted by (1,2)
($(A)!1cm!(B)$)           % 1cm from A toward B

% Perpendicular coordinates (A -| B) = (x of B, y of A)
(A |- B)                   % (x of A, y of B)

% Barycentric
(barycentric cs:A=1,B=1,C=1)  % centroid

Nodes

Basic Nodes

\node (name) at (0,0) {Text};

% Node options
\node[
  draw,                    % draw border
  fill=yellow!20,
  rectangle,               % shape (default)
  circle,
  ellipse,
  rounded corners,
  minimum width=2cm,
  minimum height=1cm,
  inner sep=5pt,           % padding
  outer sep=2pt,           % margin
  text=red,
  font=\bfseries\small,
  align=center,            % for multi-line: use \\ in text
  text width=3cm,
  anchor=north,            % positioning anchor
  rotate=45,
] (mynode) at (1,2) {Hello\\World};

Node Anchors

          north west  north  north east
                 ┌──────────┐
            west │  center   │ east
                 └──────────┘
          south west  south  south east

Also: base, mid, text, and angle anchors like 45, 135.

Nodes on Paths

\draw (0,0) -- node[above] {label} (3,0);
\draw (0,0) -- node[midway, sloped, above] {sloped text} (3,2);
\draw (0,0) -- node[pos=0.3, below] {at 30\%} (3,0);
\draw (0,0) to[out=90,in=0] node[near start, left] {A} (2,2);

Common Shapes (requires libraries)

\usetikzlibrary{shapes.geometric, shapes.misc}

\node[diamond, draw] {D};
\node[star, draw, star points=5] {S};
\node[regular polygon, regular polygon sides=6, draw] {Hex};
\node[trapezium, draw] {T};
\node[cylinder, draw, shape border rotate=90] {DB};
\node[cloud, draw, cloud puffs=10] {Cloud};
\node[cross out, draw] at (0,0) {};
\node[strike out, draw] at (0,0) {};

Arrows

\usetikzlibrary{arrows.meta}

% Arrow tips (arrows.meta syntax)
\draw[->] (0,0) -- (1,0);              % default
\draw[-Stealth] (0,0) -- (1,0);        % filled triangle
\draw[-Latex] (0,0) -- (1,0);          % larger filled
\draw[-{Stealth[length=5mm]}] (0,0) -- (1,0);
\draw[{Latex[red]}-{Latex[blue]}] (0,0) -- (1,0);  % colored
\draw[-{>[scale=2]}] (0,0) -- (1,0);

% Common tips: >, Stealth, Latex, To, Circle, Square, |, Hooks
% Modifiers: [length=..], [width=..], [open], [fill=..], [scale=..]

Styles

% Define in preamble or tikzpicture options
\tikzset{
  mybox/.style = {draw, fill=blue!20, rounded corners, minimum width=2cm},
  myarrow/.style = {-Stealth, thick, red},
  highlight/.style = {fill=yellow, draw=orange, line width=2pt},
}

% Use
\node[mybox] {Box};
\draw[myarrow] (0,0) -- (1,1);

% Style with parameters
\tikzset{
  box/.style = {draw, fill=#1!20, minimum width=1.5cm},
  box/.default = blue,
}
\node[box] {Blue};        % default
\node[box=red] {Red};     % override

% every node/.style applies to all nodes
\begin{tikzpicture}[every node/.style={font=\small}]

Foreach Loops

% Basic
\foreach \x in {0,1,2,3}
  \draw (\x, 0) circle (0.3);

% With step
\foreach \x in {0,0.5,...,3}
  \fill (\x,0) circle (1pt);

% Multiple variables
\foreach \x/\y in {0/A, 1/B, 2/C}
  \node at (\x, 0) {\y};

% Counter
\foreach \x [count=\i] in {a,b,c,d}
  \node at (\i, 0) {\x};

% Evaluate
\foreach \x [evaluate=\x as \y using \x*\x] in {1,...,5}
  \fill (\x, \y/5) circle (2pt);

% Remember
\foreach \x [remember=\x as \lastx (initially 0)] in {1,...,5}
  \draw (\lastx, 0) -- (\x, 0);

Scopes and Transformations

\begin{tikzpicture}
  \draw (0,0) -- (1,0);

  \begin{scope}[shift={(2,0)}, rotate=45, scale=0.5, red, thick]
    \draw (0,0) -- (1,0) -- (1,1) -- cycle;
  \end{scope}

  % Transformations
  % shift={(x,y)}, xshift=1cm, yshift=2cm
  % rotate=45, rotate around={45:(1,1)}
  % scale=2, xscale=2, yscale=0.5
  % xslant=0.5, yslant=0.5
\end{tikzpicture}

Clipping

\begin{tikzpicture}
  \clip (0,0) circle (1.5cm);
  % Everything below is clipped to the circle
  \fill[blue!30] (-2,-2) rectangle (2,2);
  \draw[step=0.5, gray] (-2,-2) grid (2,2);
\end{tikzpicture}

Layers (backgrounds library)

\usetikzlibrary{backgrounds}

\begin{tikzpicture}
  \node[draw, fill=white] (A) {Foreground};

  \begin{pgfonlayer}{background}
    \fill[yellow!30] (A.south west) rectangle (A.north east);
  \end{pgfonlayer}
\end{tikzpicture}

Pics

\tikzset{
  myshape/.pic = {
    \draw (-0.5,-0.5) rectangle (0.5,0.5);
    \draw (0,0) circle (0.3);
  }
}

\begin{tikzpicture}
  \pic at (0,0) {myshape};
  \pic[rotate=45, scale=1.5] at (2,0) {myshape};
\end{tikzpicture}

Decorations

\usetikzlibrary{decorations.pathmorphing, decorations.markings, decorations.text}

% Wavy/zigzag lines
\draw[decorate, decoration={zigzag, amplitude=2mm, segment length=5mm}]
  (0,0) -- (4,0);
\draw[decorate, decoration={snake, amplitude=1mm}]
  (0,0) -- (4,0);
\draw[decorate, decoration={coil, aspect=0.5}]
  (0,0) -- (4,0);
\draw[decorate, decoration={random steps, segment length=3mm}]
  (0,0) -- (4,0);

% Brace
\draw[decorate, decoration={brace, amplitude=5pt}]
  (0,0) -- (3,0) node[midway, above=5pt] {label};

% Text along path
\draw[decorate, decoration={text along path, text={Hello World}}]
  (0,0) .. controls (1,1) .. (3,0);

% Markings (arrows along path)
\draw[decoration={markings, mark=at position 0.5 with {\arrow{>}}},
  postaction={decorate}]
  (0,0) -- (3,0);

Patterns

\usetikzlibrary{patterns}

\fill[pattern=north east lines] (0,0) rectangle (2,1);
\fill[pattern=crosshatch dots, pattern color=blue] (0,0) circle (1);

% Available: north east lines, north west lines, horizontal lines,
% vertical lines, crosshatch, dots, crosshatch dots,
% fivepointed stars, sixpointed stars, bricks, checkerboard

Common Diagram Patterns

Flowchart

\usetikzlibrary{arrows.meta, shapes.geometric, positioning}

\tikzset{
  startstop/.style = {rectangle, rounded corners, draw, fill=red!20,
    minimum width=3cm, minimum height=1cm},
  process/.style = {rectangle, draw, fill=blue!20,
    minimum width=3cm, minimum height=1cm},
  decision/.style = {diamond, draw, fill=green!20,
    minimum width=3cm, minimum height=1cm, aspect=1.5},
  io/.style = {trapezium, trapezium left angle=70, trapezium right angle=110,
    draw, fill=orange!20, minimum width=3cm, minimum height=1cm},
  arrow/.style = {thick, -Stealth},
}

\begin{tikzpicture}[node distance=1.5cm]
  \node[startstop] (start) {Start};
  \node[io, below=of start] (input) {Input $x$};
  \node[decision, below=of input] (decide) {$x > 0$?};
  \node[process, below left=of decide] (neg) {$y = -x$};
  \node[process, below right=of decide] (pos) {$y = x$};
  \node[io, below=2cm of decide] (output) {Output $y$};
  \node[startstop, below=of output] (stop) {Stop};

  \draw[arrow] (start) -- (input);
  \draw[arrow] (input) -- (decide);
  \draw[arrow] (decide) -| node[near start, above] {No} (neg);
  \draw[arrow] (decide) -| node[near start, above] {Yes} (pos);
  \draw[arrow] (neg) |- (output);
  \draw[arrow] (pos) |- (output);
  \draw[arrow] (output) -- (stop);
\end{tikzpicture}

Tree

\begin{tikzpicture}[
  level 1/.style={sibling distance=4cm},
  level 2/.style={sibling distance=2cm},
  every node/.style={draw, circle, minimum size=8mm},
  edge from parent/.style={draw, -Stealth},
]
  \node {1}
    child { node {2}
      child { node {4} }
      child { node {5} }
    }
    child { node {3}
      child { node {6} }
      child { node {7} }
    };
\end{tikzpicture}

Graph / Network

\usetikzlibrary{positioning}

\begin{tikzpicture}[
  vertex/.style={draw, circle, fill=blue!20, minimum size=8mm},
  edge/.style={thick},
  >=Stealth,
]
  \node[vertex] (a) at (0,2)  {A};
  \node[vertex] (b) at (2,3)  {B};
  \node[vertex] (c) at (4,2)  {C};
  \node[vertex] (d) at (2,0)  {D};

  \draw[edge] (a) -- node[above left]  {3} (b);
  \draw[edge] (b) -- node[above right] {2} (c);
  \draw[edge] (a) -- node[below left]  {7} (d);
  \draw[edge] (c) -- node[below right] {1} (d);
  \draw[edge] (b) -- node[right]       {4} (d);
\end{tikzpicture}

Finite Automaton / State Machine

\usetikzlibrary{automata, positioning}

\begin{tikzpicture}[shorten >=1pt, node distance=2.5cm, on grid, auto,
  every state/.style={draw, minimum size=1cm}]

  \node[state, initial]           (q0) {$q_0$};
  \node[state, right=of q0]      (q1) {$q_1$};
  \node[state, accepting, right=of q1] (q2) {$q_2$};

  \path[->]
    (q0) edge              node {a}   (q1)
    (q0) edge [loop above] node {b}   ()
    (q1) edge              node {a,b} (q2)
    (q1) edge [bend left]  node {b}   (q0)
    (q2) edge [loop above] node {a}   ();
\end{tikzpicture}

Mind Map

\usetikzlibrary{mindmap}

\begin{tikzpicture}[mindmap, grow cyclic,
  every node/.style={concept, execute at begin node=\hskip0pt},
  concept color=blue!40,
  level 1/.append style={level distance=4cm, sibling angle=90},
  level 2/.append style={level distance=2.5cm, sibling angle=45},
]
  \node {Main Topic}
    child[concept color=red!40] { node {Sub 1}
      child { node {Detail A} }
      child { node {Detail B} }
    }
    child[concept color=green!40] { node {Sub 2}
      child { node {Detail C} }
    }
    child[concept color=orange!40] { node {Sub 3} }
    child[concept color=purple!40] { node {Sub 4} };
\end{tikzpicture}

Block Diagram / System Diagram

\usetikzlibrary{positioning, arrows.meta, fit}

\begin{tikzpicture}[
  block/.style={draw, rectangle, fill=blue!10, minimum height=1cm,
    minimum width=2cm, align=center},
  sum/.style={draw, circle, minimum size=6mm},
  >=Stealth, thick,
]
  \node[sum] (sum) {};
  \node[block, right=1.5cm of sum] (ctrl) {Controller\\$G_c(s)$};
  \node[block, right=1.5cm of ctrl] (plant) {Plant\\$G(s)$};
  \node[block, below=1cm of plant] (fb) {Sensor\\$H(s)$};

  \draw[->] ++(-1.5,0) -- node[above] {$R(s)$} (sum);
  \draw[->] (sum) -- node[above] {$E(s)$} (ctrl);
  \draw[->] (ctrl) -- (plant);
  \draw[->] (plant) -- ++(2,0) node[above left] {$Y(s)$};
  \draw[->] (plant.east) ++(1,0) |- (fb);
  \draw[->] (fb) -| (sum) node[near end, left] {$-$};

  \node at (sum) {$\Sigma$};
\end{tikzpicture>

Venn Diagram

\begin{tikzpicture}
  \fill[red!20]  (0,0)   circle (1.5cm);
  \fill[blue!20] (1.5,0) circle (1.5cm);

  \begin{scope}
    \clip (0,0) circle (1.5cm);
    \fill[purple!30] (1.5,0) circle (1.5cm);
  \end{scope}

  \draw (0,0) circle (1.5cm) node[left=1cm]  {$A$};
  \draw (1.5,0) circle (1.5cm) node[right=1cm] {$B$};
  \node at (0.75, 0) {$A \cap B$};
\end{tikzpicture}

Timeline

\begin{tikzpicture}
  \draw[thick, -Stealth] (0,0) -- (10,0);

  \foreach \x/\year/\event in {
    1/2020/Founded,
    3/2021/v1.0,
    5.5/2022/IPO,
    8/2023/Global%
  }{
    \draw (\x, -0.15) -- (\x, 0.15);
    \node[above=3pt] at (\x, 0.15) {\footnotesize \year};
    \node[below=3pt, align=center, text width=1.5cm] at (\x, -0.15) {\footnotesize \event};
  }
\end{tikzpicture}

Circuit (Logic Gates)

\usetikzlibrary{circuits.logic.US}

\begin{tikzpicture}[circuit logic US, every circuit symbol/.style={thick}]
  \node[and gate] (and1) at (2,1) {};
  \node[or gate]  (or1)  at (4,0.5) {};

  \draw (0,1.25) node[left] {$A$} -- (and1.input 1);
  \draw (0,0.75) node[left] {$B$} -- (and1.input 2);
  \draw (and1.output) -- (or1.input 1);
  \draw (0,0)    node[left] {$C$} -- (or1.input 2);
  \draw (or1.output) -- ++(1,0) node[right] {$Y$};
\end{tikzpicture}

Commutative Diagram (Math)

\usetikzlibrary{positioning}

\begin{tikzpicture}[>=Stealth, node distance=2cm]
  \node (A)              {$A$};
  \node (B) [right=of A] {$B$};
  \node (C) [below=of A] {$C$};
  \node (D) [right=of C] {$D$};

  \draw[->] (A) -- node[above] {$f$} (B);
  \draw[->] (A) -- node[left]  {$g$} (C);
  \draw[->] (B) -- node[right] {$h$} (D);
  \draw[->] (C) -- node[below] {$k$} (D);
\end{tikzpicture}

Plot (built-in, no pgfplots)

\begin{tikzpicture}[scale=0.8]
  \draw[->] (-0.5,0) -- (4.5,0) node[right] {$x$};
  \draw[->] (0,-0.5) -- (0,3.5) node[above] {$y$};

  \draw[blue, thick, domain=0:4, samples=100]
    plot (\x, {sqrt(\x)});

  \foreach \x in {1,...,4}
    \draw (\x, 0.1) -- (\x, -0.1) node[below] {\x};
  \foreach \y in {1,2,3}
    \draw (0.1, \y) -- (-0.1, \y) node[left] {\y};
\end{tikzpicture}

Positioning Library

\usetikzlibrary{positioning}

% Relative positioning (preferred over manual coordinates)
\node[right=of A] (B) {B};       % default separation
\node[right=1.5cm of A] (B) {B}; % custom distance
\node[above right=1cm and 2cm of A] (B) {B};  % separate x/y

% Available: above, below, left, right,
% above left, above right, below left, below right

Fit Library

\usetikzlibrary{fit}

% Draw a box around multiple nodes
\node[draw, dashed, fit=(A) (B) (C), inner sep=5pt, label=above:Group] {};

Calc Library Key Operations

\usetikzlibrary{calc}

% Midpoint
($(A)!0.5!(B)$)

% Point 1cm from A toward B
($(A)!1cm!(B)$)

% Projection of C onto line AB
($(A)!(C)!(B)$)

% Rotated point: midpoint of AB rotated 90° around A
($(A)!0.5!90:(B)$)

% Vector addition
($(A) + (1,2)$)

% Scalar multiply
($2*(A) - (B)$)

% let syntax for complex calculations
\draw let \p1 = ($(B)-(A)$),
          \n1 = {veclen(\x1,\y1)}
      in (A) circle (\n1);

Externalizing (Caching) Figures

% In preamble — compiles each tikzpicture once, reuses PDF
\usetikzlibrary{external}
\tikzexternalize[prefix=tikz-cache/]

% To skip a figure:
\tikzexternaldisable
\begin{tikzpicture} ... \end{tikzpicture}
\tikzexternalenable

Requires --shell-escape flag: pdflatex --shell-escape main.tex

Common Pitfalls

ProblemCauseFix
"Dimension too large"Coordinates too bigUse scale or smaller coords
Missing arrow tipsForgot arrows.meta library\usetikzlibrary{arrows.meta}
Node text cut offNode too smallAdd minimum width, text width
positioning not workingForgot library\usetikzlibrary{positioning}
Nodes overlapUsing at instead of relativeUse right=of with positioning lib
foreach errorsSpecial chars in bodyWrap body in {}
Path not closingForgot cycleEnd path with -- cycle
Slow compilationComplex figuresUse external library for caching
Math in nodes$ conflictsUse $...$ inside node text normally
Colors not foundMissing xcolorTikZ loads xcolor; use \usepackage[dvipsnames]{xcolor} before tikz for extra colors

Tips

  • Use positioning library — never hardcode coordinates for node layouts
  • \tikzset in preamble for reusable styles across figures
  • every node/.style, every path/.style for consistent appearance
  • Use \begin{scope} to limit option scope
  • name path=X + name intersections (intersections library) to find crossing points
  • For standalone figures: \documentclass[tikz]{standalone}
  • spy library for magnification insets
  • pgfplotstable for data-driven diagrams (see pgfplots skill)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.3%
按下载量换算231

Claude

32.15%
按下载量换算223

Cursor

21.13%
按下载量换算147

Gemini CLI

8.97%
按下载量换算62

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills