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- 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)
How to use algorithm-design
- 1.Provide a method description or existing implementation to formalize
- 2.Define clear inputs, outputs, and parameters for the algorithm
- 3.Write step-by-step pseudocode identifying main loops and recursive structures
- 4.Generate LaTeX algorithm environment using the provided templates
- 5.Create Mermaid class and sequence diagrams for system architecture
- 6.Verify consistency: map each pseudocode step to code modules and check parameter names match
- 7.Include complexity analysis as comments in the final pseudocode
Use cases
- 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
- 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
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.
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.
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.
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.
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
- Define clear inputs and outputs
- Identify the main loop / recursive structure
- Specify all parameters and their types
- 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/\Ensurefor 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
Related skills
More from lingzhi227/agent-research-skills and the wider catalog.

atomic-decomposition
Decompose research papers into atomic concepts with bidirectional math-to-code mapping.

backward-traceability
Make every number in your PDF traceable to the exact code line that produced it.

citation-management
Manage BibTeX citations for LaTeX papers with Semantic Scholar integration and validation.

code-debugging
Debug experiment code with structured error analysis and retry logic.

data-analysis
Generate rigorous statistical analysis code with multi-round review and proper uncertainty reporting.

deep-research
Conduct systematic 6-phase academic literature reviews with structured output and synthesis.