PluginBench
Skill
Pass
Audit score 90

algorithm-design

lingzhi227/agent-research-skills

Design algorithms with LaTeX pseudocode and UML diagrams for formal method documentation.

What is algorithm-design?

Formalizes methods into algorithmic pseudocode using LaTeX and system architecture diagrams using Mermaid. Use this skill when you need to document algorithms for papers, ensure consistency between pseudocode and implementation, and create publication-ready algorithmic descriptions.

  • Generate LaTeX algorithm environments with step-by-step pseudocode using algpseudocode package
  • Create Mermaid class and sequence diagrams to visualize system architecture and data flow
  • Verify consistency between pseudocode steps and actual code implementation
  • Define clear inputs, outputs, parameters, and complexity analysis for algorithms
  • Use standard algorithmic notation with line numbering for easy reference

How to install algorithm-design

npx skills add https://github.com/lingzhi227/agent-research-skills --skill algorithm-design
Prerequisites
  • LaTeX environment with algorithm and algpseudocode packages installed
  • Familiarity with pseudocode notation and UML diagram concepts
  • Access to Mermaid diagram rendering (built into most modern markdown viewers)
Claude Code
Cursor
Windsurf
Cline

How to use algorithm-design

  1. 1.Provide a method description or existing implementation to formalize
  2. 2.Define clear inputs, outputs, and parameters for the algorithm
  3. 3.Write step-by-step pseudocode identifying main loops and recursive structures
  4. 4.Generate LaTeX algorithm environment using the provided templates
  5. 5.Create Mermaid class and sequence diagrams for system architecture
  6. 6.Verify consistency: map each pseudocode step to code modules and check parameter names match
  7. 7.Include complexity analysis as comments in the final pseudocode

Use cases

Good for
  • Formalizing a machine learning training loop into pseudocode and class diagrams for a research paper
  • Documenting a recursive algorithm with both LaTeX pseudocode and sequence diagrams showing function calls
  • Verifying that all classes in a UML diagram correspond to actual code modules and parameters match
  • Creating publication-ready algorithm descriptions with complexity analysis comments
  • Designing a new data processing pipeline by first sketching it in pseudocode and UML before implementation
Who it's for
  • Researchers writing papers with algorithmic contributions
  • Computer science students formalizing coursework algorithms
  • Software architects documenting complex system designs
  • Anyone needing to bridge the gap between algorithm design and implementation

algorithm-design FAQ

What abstraction level should my pseudocode be at?

Pseudocode should be detailed enough to understand the algorithm logic but not so detailed that it reads like actual code. Aim for a level where each line represents a meaningful computational step.

How do I ensure my pseudocode matches my implementation?

Map each pseudocode step to corresponding code modules, verify all classes in UML diagrams exist in your implementation, and check that parameter names are consistent between pseudocode and code.

Can I use this for algorithms that aren't for papers?

Yes, this skill is useful for any formal algorithm documentation. However, it's particularly valuable when you need publication-ready descriptions with LaTeX formatting and UML diagrams.

What if my algorithm doesn't fit the standard algorithm environment template?

The templates are flexible. You can adapt the structure for your specific needs—use nested loops, conditionals, and function calls as needed. The key is maintaining clarity and consistency.

Should I include all implementation details in the pseudocode?

No. Keep pseudocode at the right abstraction level by omitting low-level details like memory management or specific library calls. Focus on the algorithmic logic and control flow.

Full instructions (SKILL.md)

Source of truth, from lingzhi227/agent-research-skills.


name: algorithm-design description: Design algorithms with LaTeX pseudocode and UML diagrams. Generate algorithmic environments, Mermaid class/sequence diagrams, and ensure consistency between pseudocode and implementation. Use when formalizing methods for a paper. argument-hint: [method-description]

Algorithm Design

Formalize methods into algorithm pseudocode and system architecture diagrams.

Input

  • $0 — Method description or implementation to formalize

References

  • Algorithm and diagram templates: ~/.claude/skills/algorithm-design/references/algorithm-templates.md

Workflow

Step 1: Formalize the Algorithm

  1. Define clear inputs and outputs
  2. Identify the main loop / recursive structure
  3. Specify all parameters and their types
  4. Write step-by-step pseudocode

Step 2: Generate LaTeX Pseudocode

Use algorithm + algpseudocode environments:

\begin{algorithm}[t]
\caption{Method Name}
\label{alg:method}
\begin{algorithmic}[1]
\Require Input $x$, parameters $\theta$
\Ensure Output $y$
\State Initialize ...
\For{$t = 1$ to $T$}
    \State $z_t \gets f(x_t; \theta)$
    \If{convergence criterion met}
        \State \textbf{break}
    \EndIf
\EndFor
\State \Return $y$
\end{algorithmic}
\end{algorithm}

Step 3: Generate UML Diagrams (Mermaid)

Class Diagram

classDiagram
    class Model {
        +forward(x: Tensor) Tensor
        +train_step(batch) float
    }

Sequence Diagram

sequenceDiagram
    participant M as Main
    participant D as DataLoader
    M->>D: load_data()
    D-->>M: batches

Step 4: Verify Consistency

  • Every pseudocode step must map to a code module
  • Every class in the UML must exist in the implementation
  • Parameter names must match between pseudocode and code

Rules

  • Use standard algorithmic notation (not code syntax)
  • Number lines for easy reference
  • Include complexity analysis as a comment or proposition
  • Use \Require / \Ensure for inputs/outputs
  • Keep pseudocode at the right abstraction level — not too detailed, not too vague

Related Skills

  • Upstream: atomic-decomposition, math-reasoning
  • Downstream: experiment-code, paper-writing-section
  • See also: symbolic-equation