Agent skill

Code2patent

by cat-xierluo in cat-xierluo/legal-skills

从已开发代码项目中提取技术实现证据,围绕候选专利方案生成算法/软件类说明书式技术交底书,并以“权利要求布局卡 → 发明专利初稿”两步法继续生成接近可申报版的中国发明专利起草材料。触发场景包括:读取代码仓库后撰写技术交底书、将人工总结的专利方案映射到具体实现、从代码中挖掘可专利技术方案、为专利代理师准备权利要求布局和发明专利初稿。

CC-BY-NC-4.0Auto-check passedLegal & Compliance

Install Code2patent

skills CLI
$ npx skills add cat-xierluo/legal-skills --skill code2patent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cat-xierluo/legal-skills code2patent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cat-xierluo/legal-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code2patent .claude/skills/code2patent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code2patent
GitHub stars
713
Token cost
~1.4k tokens
SKILL.md length
295 words
Files
16 (incl. references)
Skills in repo
62
Repo updated
First seen
Licence
CC-BY-NC-4.0

At a glance

从已开发代码项目中提取技术实现证据,围绕候选专利方案生成算法/软件类说明书式技术交底书,并以“权利要求布局卡 → 发明专利初稿”两步法继续生成接近可申报版的中国发明专利起草材料。触发场景包括:读取代码仓库后撰写技术交底书、将人工总结的专利方案映射到具体实现、从代码中挖掘可专利技术方案、为专利代理师准备权利要求布局和发明专利初稿。

  • Works in 5 steps: 是否已有候选专利方案清单。 → 候选清单是仅有名称,还是已有技术问题、核心实现、技术效果和代码范围。 → 本次目标是技术交底书、权利要求布局卡、发明专利初稿,还是候选方案挖掘。 → …
  • Legal & Compliance work in your project
  • SKILL.md covers 定位, 启动闸门, 输入成熟度分流 and 材料优先级, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code2patent is an agent skill from cat-xierluo/legal-skills. 从已开发代码项目中提取技术实现证据,围绕候选专利方案生成算法/软件类说明书式技术交底书,并以“权利要求布局卡 → 发明专利初稿”两步法继续生成接近可申报版的中国发明专利起草材料。触发场景包括:读取代码仓库后撰写技术交底书、将人工总结的专利方案映射到具体实现、从代码中挖掘可专利技术方案、为专利代理师准备权利要求布局和发明专利初稿。

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 18 other files, including reference files (for example `CHANGELOG.md`, `README.md` and `references/algorithm-software-disclosure-format.md`).

It sits in Legal & Compliance.

When your agent uses it

  • Legal & Compliance work in your project

Example prompts

  • “权利要求布局卡 → 发明专利初稿”
  • “/code2patent”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 是否已有候选专利方案清单。
  2. 候选清单是仅有名称,还是已有技术问题、核心实现、技术效果和代码范围。
  3. 本次目标是技术交底书、权利要求布局卡、发明专利初稿,还是候选方案挖掘。
  4. 是否有 PRD、需求说明、会议纪要、客户交底书模板、既有申请样式或代理师格式要求。
  5. 本次归档主题是什么,用于创建 archive/YYYY-MM-DD-主题/。

What it can do on your machine

Read from SKILL.md and the folder at commit c077fcc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code2patent loads about 1.4k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 44 tokens; SKILL.md has 295 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (CC-BY-NC-4.0) doesn't allow us to republish the file, so here is its outline and opening line. It has 295 words (~1,383 tokens).

name
code2patent
homepage
https://github.com/cat-xierluo/legal-skills
author
杨卫薪律师(微信ywxlaw)
version
1.6.0
license
CC-BY-NC

Read the full SKILL.md on GitHub

Files

SKILL.md and 15 other files (references) in skills/code2patent of cat-xierluo/legal-skills.

  • SKILL.md
  • CHANGELOG.md
  • LICENSE.txt
  • README.md
  • archive/.gitkeep
  • references/algorithm-software-disclosure-format.md
  • references/code-extraction-spec.md
  • references/patent-drafting-quick-reference.md
  • references/patent-drafting-spec.md
  • references/project-analysis-spec.md
  • templates/invention-patent-claim-evidence-matrix-template.md
  • templates/invention-patent-claim-layout-template.md
  • templates/invention-patent-disclosure-template.md
  • templates/invention-patent-draft-self-check-template.md
  • templates/invention-patent-draft-template.md
  • templates/patent-title-clarification-card-template.md

Open the folder on GitHubat commit c077fcc

Compare with similar skills

Code2patent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code2patent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code2patent this skillcat-xierluo/legal-skills713—~1.4kAutomated safety check: PassCC-BY-NC-4.0
Paper to Chinese Patent DrafterYuan1z0825/nature-skills46k1 repos~1.1kAutomated safety check: PassApache-2.0
C15tc15t/c15t1.9k1 repos~1.6kAutomated safety check: PassApache-2.0
Contract Reviewevolsb/claude-legal-skill4621 repos~3.6kAutomated safety check: PassMIT
Legal Clinic Client Intakeanthropics/claude-for-legal9.6k3 repos~3.2kAutomated safety check: PassApache-2.0
Paper To Cn Patentsnipp-zha/Paper-to-patent-Skill1051 repos~959Automated safety check: PassNone

Similar skills

  • Paper to Chinese Patent Drafter

    Yuan1z0825/nature-skills

    Drafts Chinese invention patent applications and technical disclosures from research papers or inventor materials, tying each claim feature to source evidence.

    46k GitHub starsUsed in 1 repo~1.1k tokens
    Legal & ComplianceAuto-check passed
  • C15t

    c15t/c15t

    Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript.

    1.9k GitHub starsUsed in 1 repo~1.6k tokens
    Legal & ComplianceAuto-check passed
  • Contract Review

    evolsb/claude-legal-skill

    Review legal contracts, NDAs, employment agreements, SaaS terms, and M&A documents.

    462 GitHub starsUsed in 1 repo~3.6k tokens
    Legal & ComplianceAuto-check passed
  • Legal Clinic Client Intake

    anthropics/claude-for-legal

    Official

    Structures a legal clinic client intake interview and produces a case summary with cross-area issue spotting, conflict flags and triage classification.

    9.6k GitHub starsUsed in 3 repos~3.2k tokens
    Legal & ComplianceAuto-check passed
  • Paper To Cn Patent

    snipp-zha/Paper-to-patent-Skill

    Convert scientific papers, theses, technical reports, source code, figures, or research manuscripts into evidence-grounded Chinese invention patent drafts.

    105 GitHub starsUsed in 1 repo~959 tokens
    Legal & ComplianceAuto-check passed
  • Employment Contract Templates

    ynulihao/AgentSkillOS

    Create employment contracts, offer letters, and HR policy documents following legal best practices.

    617 GitHub starsUsed in 12 repos~4.1k tokens
    Legal & ComplianceAuto-check passed

More from cat-xierluo/legal-skills

All 62 skills in this repo
  • Elements-Style Complaint Generator

    cat-xierluo/legal-skills

    Converts a lawyer's ordinary complaint or a described case into the Supreme People's Court's elements-style Word template, with layout checks on the result.

    713 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check: notes
  • Lecture Performance Review

    cat-xierluo/legal-skills

    Analyzes raw lecture transcripts for verbal tics, pacing, time use and promise follow-through, with optional slide-by-slide comparison and cross-session tracking.

    713 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • De-AI Polish for Chinese Articles

    cat-xierluo/legal-skills

    Detects and rewrites machine-sounding patterns in the body text of Chinese articles while keeping the author's facts, headings and legal terms intact.

    713 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • GitHub Star Manager

    cat-xierluo/legal-skills

    Finds GitHub projects mentioned in articles or screenshots and stars them, tracks updates to your starred repos, and builds an HTML dashboard to browse them.

    713 GitHub stars~2k tokensUpdated yesterday
    Auto-check: notes
  • Legal Harness Initializer

    cat-xierluo/legal-skills

    Sets up or incrementally updates AGENTS.md and CLAUDE.md for legal professionals, with a minimal safety baseline and a check that a new session loads and follows the rules.

    713 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Moot Court Simulation Builder

    cat-xierluo/legal-skills

    Chinese-language skill that organizes a case file into a multi-role mock trial with judge, parties and clerk, producing a transcript, issue review and a to-strengthen list.

    713 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed

Questions about Code2patent

What does Code2patent do?

从已开发代码项目中提取技术实现证据,围绕候选专利方案生成算法/软件类说明书式技术交底书,并以“权利要求布局卡 → 发明专利初稿”两步法继续生成接近可申报版的中国发明专利起草材料。触发场景包括:读取代码仓库后撰写技术交底书、将人工总结的专利方案映射到具体实现、从代码中挖掘可专利技术方案、为专利代理师准备权利要求布局和发明专利初稿。. Code2patent is an agent skill from cat-xierluo/legal-skills.

When should I use Code2patent?

Code2patent fits situations like: legal & Compliance work in your project.

How do I install Code2patent in Claude Code?

Run `npx skills add cat-xierluo/legal-skills --skill code2patent -a claude-code`. Or copy the skill folder (skills/code2patent in cat-xierluo/legal-skills) into .claude/skills/code2patent in your project. Claude Code loads it when a task matches its description.

How do I install Code2patent in Codex?

Run `npx skills add cat-xierluo/legal-skills --skill code2patent -a codex`. Or copy the skill folder (skills/code2patent in cat-xierluo/legal-skills) into .agents/skills/code2patent in your project. Codex loads it when a task matches its description.

Can I use Code2patent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cat-xierluo/legal-skills --skill code2patent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code2patent, .gemini/skills/code2patent, .github/skills/code2patent and .opencode/skills/code2patent in your project.

What does Code2patent need to run?

SKILL.md names no scripts, command-line tools or credentials: Code2patent is instructions for the agent only.

Does Code2patent access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code2patent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code2patent use?

Code2patent is published under the CC-BY-NC-4.0 licence (declared in SKILL.md).

How many tokens does Code2patent use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to Code2patent?

Skills that share tags, products or a category with Code2patent: Paper to Chinese Patent Drafter (Yuan1z0825/nature-skills, 46k stars), C15t (c15t/c15t, 1.9k stars), Contract Review (evolsb/claude-legal-skill, 462 stars) and Legal Clinic Client Intake (anthropics/claude-for-legal, 9.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code2patent?

cat-xierluo (a GitHub user) maintains it in cat-xierluo/legal-skills, which has 713 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on October 7, 2026.

Source: cat-xierluo/legal-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.