Get the FREE Ultimate OpenClaw Setup Guide →

code-template-manager

Scanned
npx machina-cli add skill a5c-ai/babysitter/code-template-manager --openclaw
Files (1)
SKILL.md
1.8 KB

Code Template Manager Skill

Purpose

Manage and generate competitive programming code templates for various algorithms, data structures, and common patterns across multiple languages.

Capabilities

  • Store and retrieve algorithm templates (C++, Python, Java)
  • Fast I/O templates for different languages
  • Data structure templates (segment tree, DSU, etc.)
  • Template customization and versioning
  • Generate problem-specific boilerplate
  • Maintain personal template library

Target Processes

  • cp-library-creation
  • codeforces-contest
  • algorithm-implementation
  • atcoder-contest

Template Categories

  1. I/O Templates: Fast input/output for each language
  2. Data Structures: Segment tree, Fenwick tree, DSU, Treap, etc.
  3. Graph Algorithms: DFS, BFS, Dijkstra, Bellman-Ford, etc.
  4. Number Theory: Modular arithmetic, prime sieve, FFT/NTT
  5. String Algorithms: KMP, Z-function, Suffix array, Hashing
  6. Geometry: Point, Line, Polygon primitives

Input Schema

{
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": ["get", "list", "create", "update", "generateBoilerplate"]
    },
    "templateName": { "type": "string" },
    "language": { "type": "string", "enum": ["cpp", "python", "java"] },
    "category": { "type": "string" },
    "code": { "type": "string" }
  },
  "required": ["action"]
}

Output Schema

{
  "type": "object",
  "properties": {
    "success": { "type": "boolean" },
    "template": { "type": "string" },
    "templates": { "type": "array" },
    "error": { "type": "string" }
  },
  "required": ["success"]
}

Source

git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/specializations/algorithms-optimization/skills/code-template-manager/SKILL.mdView on GitHub

Overview

Manage, store, and generate competitive programming templates across C++, Python, and Java. It covers I/O templates, common data structures, and problem boilerplate, enabling faster contest setups and consistent coding patterns with versioned templates.

How This Skill Works

Templates are organized by category (I/O, Data Structures, Graphs, Number Theory, etc.) and language. You invoke actions such as get, list, create, update, or generateBoilerplate to fetch, modify, or generate code snippets, customize templates, or build problem-specific boilerplate, all from a centralized library. The system supports versioning to keep your templates aligned with evolving contest needs.

When to Use It

  • During cp-library-creation to build a reusable set of templates across languages
  • Before a Codeforces or AtCoder contest to generate problem-specific boilerplate
  • When implementing common patterns (segment trees, DSU, Dijkstra) quickly
  • When you need fast I/O scaffolding tailored to your language of choice
  • When organizing and updating templates for new contest problems or standards

Quick Start

  1. Step 1: Define your language and category for the template
  2. Step 2: Use action 'create' to add a new template or 'generateBoilerplate' for a problem
  3. Step 3: Use action 'generateBoilerplate' with language and templateName to produce ready-to-submit code

Best Practices

  • Tag templates by language and category to speed up lookup
  • Version-control templates and document changes for traceability
  • Keep I/O templates consistent across cpp/python/java
  • Test generated boilerplate by compiling and running small samples
  • Review and prune unused templates to avoid bloat

Example Use Cases

  • Create a reusable C++ segment tree template and reuse across problems
  • Generate a Python fast I/O boilerplate for a Codeforces round
  • Store and fetch AtCoder problem boilerplate with prebuilt DSU and graph setup
  • Update template library with a new modular arithmetic helper for number theory
  • Produce problem-specific boilerplate with a standard main(), fast IO, and clear headers

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers