Agent skill

Project Init

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

项目初始化工具。读取全局协议 ~/.claude/CLAUDE.md,分析项目实际情况,生成项目特定的 CLAUDE.md 和 docs/ 上下文。本技能应在用户说"初始化项目"、"项目设置"、"配置 Claude Code"、"新建项目配置"时使用,或在进入一个新项目需要快速配置时使用。不要用于:Skill 内容开发或验收(用 skill-lint)、单次 Skill 安装(用…

MITAuto-check passedAgent Workflows

Install Project Init

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

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

GitHub CLI
$ gh skill install cat-xierluo/legal-skills project-init --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/project-init .claude/skills/project-init && 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
project-init
GitHub stars
713
Token cost
~1k tokens
SKILL.md length
259 words
Files
17 (incl. scripts, assets)
Skills in repo
62
Repo updated
First seen
Licence
MIT

At a glance

项目初始化工具。读取全局协议 ~/.claude/CLAUDE.md,分析项目实际情况,生成项目特定的 CLAUDE.md 和 docs/ 上下文。本技能应在用户说"初始化项目"、"项目设置"、"配置 Claude Code"、"新建项目配置"时使用,或在进入一个新项目需要快速配置时使用。不要用于:Skill 内容开发或验收(用 skill-lint)、单次 Skill 安装(用…

  • Works in 12 steps: 读取全局协议 → 读取配置 → 检测项目类型 → …
  • Tasks that involve Agent instruction files
  • SKILL.md covers 工作流程, 配置说明, 资源目录 and 幂等性
  • Runs Shell scripts from its folder; calls bash

What it does

Project Init is an agent skill from cat-xierluo/legal-skills. 项目初始化工具。读取全局协议 ~/.claude/CLAUDE.md,分析项目实际情况,生成项目特定的 CLAUDE.md 和 docs/ 上下文。本技能应在用户说"初始化项目"、"项目设置"、"配置 Claude Code"、"新建项目配置"时使用,或在进入一个新项目需要快速配置时使用。不要用于:Skill 内容开发或验收(用 skill-lint)、单次 Skill 安装(用 skill-manager)、代码生成。

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 20 other files, including scripts and assets (for example `CHANGELOG.md`, `assets/claude-settings-template.json` and `config/profiles.example.yaml`).

It sits in Agent Workflows, covering Agent instruction files and Skill management. The licence is MIT.

When your agent uses it

  • Tasks that involve Agent instruction files
  • Tasks that involve Skill management

Example prompts

  • “配置 Claude Code”
  • “新建项目配置”
  • “/project-init”

Requirements

  • A Bash shell

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. 读取全局协议
  2. 读取配置
  3. 检测项目类型
  4. 分析项目
  5. 展示计划并确认
  6. 创建 .claude/ 和安装 Skill
  7. 生成 AGENTS.md 和 CLAUDE.md
  8. 生成 settings.json
  9. 创建 .codex/ 和 .agents/ 目录
  10. 生成 docs/ 文档
  11. 创建 .gitignore
  12. Skill 脚手架(仅 skill-project 类型)

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

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    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

Project Init loads about 1k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 259 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~1k

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); the scripts in this folder are not scanned.

SKILL.md

The full file from cat-xierluo/legal-skills at commit c077fcc, republished under its MIT licence (© cat-xierluo). 259 words, ~1,047 tokens.

Download SKILL.mdSave it as .claude/skills/project-init/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
project-init
description
项目初始化工具。读取全局协议 ~/.claude/CLAUDE.md,分析项目实际情况,生成项目特定的 CLAUDE.md 和 docs/ 上下文。本技能应在用户说"初始化项目"、"项目设置"、"配置 Claude Code"、"新建项目配置"时使用,或在进入一个新项目需要快速配置时使用。不要用于:Skill 内容开发或验收(用 skill-lint)、单次 Skill 安装(用 skill-manager)、代码生成。
homepage
https://github.com/cat-xierluo/legal-skills
author
杨卫薪律师(微信ywxlaw)
version
1.2.6
license
MIT License - 详见 LICENSE.txt

Project Init

读取全局协议,分析项目,生成上下文。

工作流程

Step 1: 读取全局协议

读取 ~/.claude/CLAUDE.md(及其 @include 引用的文件),理解全局协作协议。这是生成项目上下文的基准——项目文档的格式和结构应对齐全局协议中的定义(如文档体系、SOP、DECISIONS 格式等)。

Step 2: 读取配置

读取本 skill 目录下的 config/profiles.yaml,获取:

  • skill_sources: Skill 源仓库路径
  • profiles: 各项目类型的检测规则和 Skill 列表
Step 3: 检测项目类型
  1. 调用 scripts/init.sh detect <project_dir> 获取指示文件列表。
  2. 按配置中 profiles 的定义顺序评估 detect 规则:
    • any_of: 任一文件存在即匹配
    • has_skill_md: 根目录或 skills/ 子目录下存在 SKILL.md
    • extensions: 指定扩展名文件数 >= min_count
    • dir_patterns: 任一目录名存在即匹配
  3. 第一个命中的 profile 即为检测结果。未命中则使用 default_profile。
Step 4: 分析项目

在生成任何文件之前,先分析项目实际情况:

  • 读取 package.json / pyproject.toml / Cargo.toml 等获取技术栈
  • 扫描目录结构了解项目架构(src/、app/、lib/ 等)
  • 读取已有的 README.md 或代码了解项目用途
  • 检查是否已有 .claude/、CLAUDE.md、docs/ 等

将这些信息汇总,作为后续生成上下文的素材。

Step 5: 展示计划并确认

向用户展示检测结果和生成计划,必须等待确认。若计划使用文件化任务源,同时说明:

  • 任务文件的名称与位置;
  • 根据风险与复杂度选择的 Lite、Standard 或 Strict 配置及理由;
  • 将写入的首批真实任务,以及已有任务文件的合并或跳过策略。
Step 6: 创建 .claude/ 和安装 Skill
bash
mkdir -p .claude/skills/

对 profile 中 skills 字段列出的每个 Skill,通过调用 skill-manager Skill 以符号链接方式安装到项目的 .claude/skills/ 目录。skill-manager 会自动处理路径解析、去重和版本追踪。

Step 7: 生成 AGENTS.md 和 CLAUDE.md

不是复制模板,而是基于全局协议 + 项目分析结果生成项目特定的 AGENTS.md。

参考 templates/agents-template.md 中各项目类型的结构模板和生成指南,结合 Step 4 的分析结果,生成包含真实项目信息的内容,写入 AGENTS.md。

templates/agents-template.md 包含所有项目类型的段落定义、结构模板和脱敏范例,无需参考其他外部文件。

CLAUDE.md 不重复写内容,仅写入:

@include ./AGENTS.md

这样 Claude Code 和 Codex 共享同一份项目协议,只维护一个源文件。

已有 AGENTS.md 时展示 diff,让用户决定覆盖/合并/跳过。已有 CLAUDE.md 但内容不是纯 @include 时,同样展示 diff。

Step 8: 生成 settings.json

将 assets/claude-settings-template.json 原样复制为项目 .claude/settings.json。已有则跳过。

Step 9: 创建 .codex/ 和 .agents/ 目录
bash
bash scripts/init.sh codex "<project_dir>"
bash scripts/init.sh agents "<project_dir>"

创建 .codex/ 目录结构:

  • config.toml:从 assets/codex-config.toml 复制
  • rules/default.rules:从 assets/codex-default.rules 复制
  • skills:符号链接 → ../.claude/skills(与 .claude/skills/ 共享,不重复安装)

创建 .agents/ 目录结构:

  • skills:符号链接 → ../.claude/skills,供遵循 .agents 目录约定的代理发现同一批 Skill

两者已有则跳过。目录级软链确保各代理目录与 .claude/skills/ 共享同一 Skill 源:向 .claude/skills/ 安装或移除 Skill 时自动同步,不逐 skill 复制或双写链接。.codex/skills 软链确保 Codex 能直接访问 .claude/skills/ 中已安装的 Skill。

Step 10: 生成 docs/ 文档

不是复制空模板,而是基于全局协议的文档体系定义 + 项目分析结果生成有实际内容的文档。

按需读取对应文档模板,结合项目选择的协作文档体系生成真实初始内容;不要复制空壳或保留占位符:

  • docs/ROADMAP.md: 读取 templates/roadmap-template.md,从 README、版本和当前实现提取愿景、状态与阶段规划
  • docs/DECISIONS.md: 读取 templates/decision-log-template.md,记录真实存在的初始化决策和工作日志,不虚构备选方案
  • 任务清单文件: 仅当项目选择文件化任务源时创建;读取 templates/task-template.md,根据项目风险选择一个任务配置,生成真实队列与任务卡。不要逐字复制生成指南,也不要生成与所选配置无关的空章节。文件名和位置由项目上下文决定
  • docs/ARCHITECTURE.md: 读取 templates/architecture-template.md,从目录结构、入口和技术栈生成初始架构描述
  • DESIGN.md: 仅包含前端的项目读取 templates/design-template.md,结合实际设计系统和技术栈生成
  • CHANGELOG.md: 项目需要变更日志且文件不存在时读取 templates/changelog-template.md,使用明确版本号和日期生成初始化记录

任务文件只作为当前任务入口:长期方向留在 ROADMAP,重要取舍留在 DECISIONS,用户可见历史留在 CHANGELOG。任务完成并同步相应文档后,从活跃区移除;不为任务文件创建快照、before 副本或专用历史归档。仅创建不存在的文件;已有任务文件时展示 diff,由用户决定合并或跳过,不直接覆盖。

Step 11: 创建 .gitignore

将 assets/gitignore-template 原样复制为项目 .gitignore。已有则跳过。

Step 12: Skill 脚手架(仅 skill-project 类型)
bash
bash scripts/init.sh scaffold "<project_dir>" "<skill_name>"

创建 references/、scripts/、assets/、SKILL.md、LICENSE.txt。

配置说明

编辑 config/profiles.yaml 自定义。

资源目录

  • templates/:读取后结合项目事实选择、裁剪和填充;不得原样复制,也不得保留占位符。文件统一使用 *-template.md,避免与生成目标同名或命中常见 Git 忽略规则。
  • assets/:不需要载入上下文,按步骤或脚本原样复制到目标位置;已有目标文件时遵循幂等规则。
  • 新增资源时按消费方式归类,不按文件扩展名归类。同为文本文件,需理解后生成的进入 templates/,固定内容进入 assets/。

幂等性

符号链接相同目标 → 跳过;文件已存在 → 不覆盖。

© cat-xierluo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 16 other files (scripts, assets) in skills/project-init of cat-xierluo/legal-skills.

  • SKILL.md
  • CHANGELOG.md
  • LICENSE.txt
  • assets/claude-settings-template.json
  • assets/codex-config.toml
  • assets/codex-default.rules
  • assets/gitignore-template
  • config/profiles.example.yaml
  • scripts/init.sh
  • templates/agents-template.md
  • templates/architecture-template.md
  • templates/changelog-template.md
  • templates/decision-log-template.md
  • templates/design-template.md
  • templates/roadmap-template.md
  • templates/task-template.md
  • templates/user-agents-backup-template.md

Open the folder on GitHubat commit c077fcc

Compare with similar skills

Project Init 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.

Project Init compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Project Init this skillcat-xierluo/legal-skills713—~1kAutomated safety check: PassMIT
Using Agent Skillsaddyosmani/agent-skills103k4 repos~2.4kAutomated safety check: PassMIT
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~12kAutomated safety check: PassCC-BY-4.0
Rules Distillationaffaan-m/ECC275k2 repos~2.3kAutomated safety check: PassMIT
Birdview Skills Compatibility AuditQiuner/birdview721—~794Automated safety check: PassMIT
Context Routing Auditwithkynam/vibecode-pro-max-kit1.1k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Using Agent Skills

    addyosmani/agent-skills

    Meta-skill for choosing which workflow skill fits the task at hand, plus always-on habits: surface assumptions, stop on confusion, push back, keep it simple and stay in scope.

    103k GitHub starsUsed in 4 repos~2.4k tokens
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~12k tokens
    Agent WorkflowsAuto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    275k GitHub starsUsed in 2 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Audits the AI skills installed for a project for duplicate names, broad triggers and conflicting instructions, without changing any of them.

    721 GitHub stars~794 tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • Context Routing Audit

    withkynam/vibecode-pro-max-kit

    Audits a project's context routing, skill discoverability and skill wiring by running a chain of validator scripts and fixing whatever they report.

    1.1k GitHub stars~1.2k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Mistral Vibe CLI Reference

    mistralai/mistral-vibe

    Official

    Reference for Mistral Vibe, the CLI agent it runs inside: config files, env vars, agents, skills, tools, hooks and MCP servers, so the agent can explain and troubleshoot its own setup.

    5.1k GitHub stars~14k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes

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

Categories

Questions about Project Init

What does Project Init do?

项目初始化工具。读取全局协议 ~/.claude/CLAUDE.md,分析项目实际情况,生成项目特定的 CLAUDE.md 和 docs/ 上下文。本技能应在用户说"初始化项目"、"项目设置"、"配置 Claude Code"、"新建项目配置"时使用,或在进入一个新项目需要快速配置时使用。不要用于:Skill 内容开发或验收(用 skill-lint)、单次 Skill 安装(用…. Project Init is an agent skill from cat-xierluo/legal-skills.

When should I use Project Init?

Project Init fits situations like: tasks that involve Agent instruction files; tasks that involve Skill management.

How do I install Project Init in Claude Code?

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

How do I install Project Init in Codex?

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

Can I use Project Init 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 project-init -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/project-init, .gemini/skills/project-init, .github/skills/project-init and .opencode/skills/project-init in your project.

What does Project Init need to run?

Going by SKILL.md and its folder, Project Init needs a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: A Bash shell.

Does Project Init 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 Project Init 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Project Init use?

Project Init is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Project Init use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Project Init?

Skills that share tags, products or a category with Project Init: Using Agent Skills (addyosmani/agent-skills, 103k stars), Task Observer (rebelytics/one-skill-to-rule-them-all, 3.2k stars), Rules Distillation (affaan-m/ECC, 275k stars) and Birdview Skills Compatibility Audit (Qiuner/birdview, 721 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Project Init?

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.