algorithm_code_standards

A set of rules for writing algorithm code that can later be checked automatically and packaged as MCP services, which let AI tools call specific functions. It covers function structure, type annotations, documentation, dependencies, and basic code quality.

In plain words
What is it for?
Use it when writing algorithm-model code for the Zhongzhi Workshop platform. It guides the structure of the Python file, its main function, input checks, logging, documentation, and optional Flask API layer.
Why use it?
It reduces failures when the platform analyzes, tests, or packages submitted algorithm code. It also makes each main function easier to call and test on its own.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fdueblab/micro-agent/algorithm_code_standards
Any agent
npx skills add fdueblab/Micro-Agent --skill algorithm_code_standards
Clone the repo
git clone --depth 1 https://github.com/fdueblab/Micro-Agent

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 421 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00421
Opus 5 $0.00000 $0.00211
Sonnet 5 $0.00000 $0.00084
Haiku 4.5 $0.00000 $0.00042

Measured 2d ago against content hash f50dbca24d3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

algorithm_code_standards scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workspace/skills/algorithm_code_standards/SKILL.md · 35 lines

What it actually says

算法代码提交规范

本技能定义了众智工场平台的算法代码提交要求,适用于「算法模型想定式开发」任务。 生成的代码必须满足以下规范,以便后续在平台进行自动代码分析与封装为 MCP 服务。

核心函数独立性(最重要)

  • 每个可被封装为 MCP 工具的核心函数必须能单独直接调用,不依赖模块级/全局可变状态。
  • 模型加载、配置读取、资源路径解析等必须在函数内部完成。
  • 禁止在函数外 model = load_model() 再在函数内使用。
  • 推荐每次调用在函数内完成加载以保证独立性与可测试性。

类型注解与 Google 风格文档字符串

  • 所有对外核心函数必须具备完整类型注解(参数与返回值)。
  • 每个核心函数必须使用 Google 风格 docstring:
    • 第一行:简短功能描述
    • Args: 列出每个参数
    • Returns: 列出返回值含义

代码结构

  • 算法层:清晰的顶层函数,必须包含 main_process(...) 主入口,签名带完整类型注解。
  • Web 层(可选推荐):Flask + flask-restx 生成 Swagger,路由只做参数校验与调用核心函数。
  • 保存为单文件 {model_name}_algorithm.py
  • 文件顶部用注释块列出依赖清单(pip requirements 风格,带版本号)。

质量要求

  • 语法正确,可直接 python <文件名>.py 运行。
  • 符合 PEP 8。
  • 适当的 try/except、输入校验与日志。
  • 不要使用省略号或 pass 代替真实实现。
  • 如有参考来源,在 docstring 中标注。
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 35 lines · 0 tokens per session scan A f50dbca24d3c

Subscribe to this mod's changes

algorithm_code_standards is a skill published in the GitHub repository fdueblab/Micro-Agent (99 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 421 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.