Agent skill

Harness Init

by k1ein-chen in k1ein-chen/Harness-Starter

Initialize this project with the Harness Engineering starter template.

MITAuto-check: notesAgent Workflows

Install Harness Init

skills CLI
$ npx skills add k1ein-chen/Harness-Starter --skill harness-init -a claude-code

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

GitHub CLI
$ gh skill install k1ein-chen/Harness-Starter harness-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/k1ein-chen/Harness-Starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/harness-init .claude/skills/harness-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
harness-init
GitHub stars
119
Token cost
~995 tokens
SKILL.md length
282 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Initialize this project with the Harness Engineering starter template.

  • Works in 9 steps: :检查模板文件是否存在 → 检测项目信息 → 填写 CLAUDE.md → …
  • The user wants to set up
  • SKILL.md covers Step 0:检查模板文件是否存在, Step 1: 检测项目信息, Step 2: 填写 CLAUDE.md and Step 3: Skill 路由发现, plus 5 more sections
  • Calls node, git and npm; reaches github.com

What it does

Harness Init is an agent skill from k1ein-chen/Harness-Starter. Initialize this project with the Harness Engineering starter template. Detects project language, installs dependencies, and updates CLAUDE.md placeholders. Use when the user wants to set up or reset the Harness configuration.

Its SKILL.md is about 1000 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Agent instruction files and Project scaffolding. It works with npm. The repository describes itself as: 一套成熟完善的开箱即用的 Claude Code Harness Engineering 模板。三层自动化(安全/感知/审查),集成 LSP、OpenSpec SDD 工作流和 AI 一键初始化。新项目和已有项目均可使用。 The licence is MIT.

When your agent uses it

  • The user wants to set up
  • Reset the Harness configuration

Example prompts

  • “/harness-init”

Requirements

  • Python 3
  • Node.js

Workflow steps

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

  1. :检查模板文件是否存在
  2. 检测项目信息
  3. 填写 CLAUDE.md
  4. Skill 路由发现
  5. 检查 Hook 文件
  6. 检查并安装 LSP
  7. 检查 OpenSpec(可选)
  8. 运行健康检查
  9. 完成提示

What it can do on your machine

Read from SKILL.md and the folder at commit c211c43. 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

    Shell commands in SKILL.md call:

    • node
    • git
    • npm

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    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

Harness Init loads about 995 tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 282 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:134
    - `pre-tool-check.mjs` — 防止 AI 修改 .env / 高危命令

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

The full file from k1ein-chen/Harness-Starter at commit c211c43, republished under its MIT licence (© k1ein-chen). 282 words, ~995 tokens.

Download SKILL.mdSave it as .claude/skills/harness-init/SKILL.md (or your agent's skills folder).
name
harness-init
description
Initialize this project with the Harness Engineering starter template. Detects project language, installs dependencies, and updates CLAUDE.md placeholders. Use when the user wants to set up or reset the Harness configuration.

Harness Init

适用三种场景:

  • GitHub 安装:用户说"帮我用 Harness Starter 初始化"——还没有模板文件
  • 新项目:模板刚复制过来,CLAUDE.md 含占位符
  • 已有项目:项目已经开发到一半,想加入 Harness

Step 0:检查模板文件是否存在

检查项目根目录下是否有 .agents/hooks/ 和 AGENTS.md。

如果不存在(GitHub 安装场景)

用户直接让 AI 安装 Harness Starter,还没有模板文件。需要:

  1. 从 package.json 的 repository 字段获取仓库地址,克隆到临时目录:
    git clone https://github.com/<package.json repository>.git /tmp/harness-starter
  2. 复制核心文件到项目:
    cp -r /tmp/harness-starter/.agents/  .agents/
    cp -r /tmp/harness-starter/.claude/  .claude/
    cp -r /tmp/harness-starter/docs/     docs/
    cp    /tmp/harness-starter/AGENTS.md ./
    cp    /tmp/harness-starter/CLAUDE.md ./
    cp    /tmp/harness-starter/.lsp.json ./
    cp    /tmp/harness-starter/.gitignore ./.gitignore 2>/dev/null || true
    cp -r /tmp/harness-starter/scripts/  ./scripts/ 2>/dev/null || true
  3. 清理临时目录
  4. 继续执行 Step 1
如果已存在

跳过 Step 0,直接执行 Step 1。

Step 1: 检测项目信息

优先从已有文件自动推断,推断不到再问用户:

检查以下文件,提取项目信息:

  • package.json → 项目名、技术栈(React/Vue/Next 等)、测试框架(jest/vitest 等)
  • pyproject.toml → 项目名、Python 依赖
  • go.mod → 模块名、Go 版本
  • Cargo.toml → 项目名、Rust 依赖
  • composer.json → PHP 项目
  • Gemfile → Ruby 项目
  • CMakeLists.txt → C/C++ 项目

对于多语言项目,选择主要技术栈填写。

Step 2: 填写 CLAUDE.md

如果是新项目(含占位符)

用 Step 1 检测到的信息替换 CLAUDE.md 中的 【待填写】 占位符。 如果无法自动推断,询问用户:

  • 用途:这个项目是做什么的?
  • 技术栈:用什么语言/框架?
  • 跑测试:用什么命令?
如果是已有项目(不含占位符)

检查 CLAUDE.md 是否已包含以下核心章节:

  • Karpathy 原则(Think Before Coding / 消除信息差 / 讨论与执行分离 / Simplicity First / Surgical Changes / Goal-Driven Execution)
  • 全局约定
  • 自动审查闭环

如果缺失,补充进去。已有的内容不要覆盖。

Step 3: Skill 路由发现

根据 Step 1 检测到的技术栈,扫描当前可用的 Skill,询问用户最常见的任务类型,生成路由表写入 CLAUDE.md。

3.1 扫描可用 Skill

检查以下位置,汇总所有可用 Skill:

  1. .claude/skills/ — 项目本地 Skill(如 harness-init、harness-mode)
  2. ~/.claude/skills/ — 用户全局 Skill
  3. 当前会话中 [Available Skills] 列表
  4. MCP 工具列表(如果有)
3.2 推断任务场景

根据技术栈列出常见任务类型,例如:

技术栈常见任务可路由 Skill
React/Next.js组件开发、性能优化vercel-react-best-practices
前端/UI页面/H5/幻灯片frontend-slides
Node.js/npm包管理、构建项目已有 Skill
Python测试、格式化项目已有 Skill
公众号/内容微信排版、写作wechat-article-formatter

原则:只推荐当前会话中实际可用的 Skill,不要假设用户安装了某个 Skill。

3.3 写入路由表

在 CLAUDE.md 末尾追加一个 # Skill 路由 章节,格式如下:

markdown
# Skill 路由

根据项目技术栈和任务类型,推荐以下 Skill:

| 任务类型 | Skill | 触发条件 |
|---------|-------|---------|
| React 组件开发 | vercel-react-best-practices | 涉及 .tsx / .jsx 文件修改 |
| 微信文章排版 | wechat-article-formatter-skill | 用户要求排版/发布公众号内容 |
| Harness 管理 | harness-init / harness-mode | 用户要求调整 Harness 配置 |
| [项目已有] | [skill-name] | [触发场景] |

> Agent 在遇到对应任务时,应优先调用路由表中的 Skill。
3.4 询问用户

生成路由表后,向用户确认:

  • "我根据你的技术栈(XXX)推荐了这些 Skill 路由,有没有需要增减的?"
  • 用户确认后写入 CLAUDE.md
  • 如果用户不确定,先写入推荐的,告诉用户随时可以改

Step 4: 检查 Hook 文件

检查 .agents/hooks/ 下核心文件是否存在:

  • pre-tool-check.mjs — 防止 AI 修改 .env / 高危命令
  • session-context.mjs — 自动注入 git 状态 + 最新交接断点
  • post-tool-check.mjs — (可选)自动格式化
  • pre-compact.mjs — (可选)压缩前保存状态快照

缺失则从模板复制。已有则跳过,不要覆盖。

检查 .claude/settings.json 中是否注册了 Hook(PreToolUse / SessionStart 等)。 缺失则补充,已有的其他配置不要删除。

Step 5: 检查并安装 LSP

检查 typescript-language-server 是否可用。 如果不可用,根据 Step 1 检测到的语言安装对应的 language server。

如果 .lsp.json 里的语言配置和项目不符,根据检测结果修改。

Step 6: 检查 OpenSpec(可选)

询问用户是否需要规范驱动开发工作流。 如果用户确认:

  • 安装 CLI:npm install -g @fission-ai/openspec
  • 初始化:openspec init
  • OpenSpec 会在 .claude/ 下添加 commands 和 skills,不要阻止

Step 7: 运行健康检查

执行 node scripts/check.mjs,向用户展示结果。 如果有失败项,逐一处理。

可选:向用户介绍 GC 扫描:

  • node scripts/gc-scan.mjs — 手动执行 8 维度健康扫描
  • 扫描结果输出或通过 CI 门禁检查

Step 8: 完成提示

向用户说明当前 Harness 状态:

  • 已启用的 Hook(PreToolUse / SessionStart)
  • 已安装的依赖(LSP / OpenSpec)
  • 还需要用户手动做的事(如果有)

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

Files

Just SKILL.md in .claude/skills/harness-init of k1ein-chen/Harness-Starter.

Open the folder on GitHubat commit c211c43

Compare with similar skills

Harness 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.

Harness Init compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Harness Init this skillk1ein-chen/Harness-Starter119—~995Automated safety check: NotesMIT
Agent Prompts Warmupiamtouchskyer/memex143—~1kAutomated safety check: PassMIT
Md StarterInfrasity-Labs/dev-gtm-claude-skills139—~2kAutomated safety check: PassMIT
Ad HooksCorridorTech/PoseCap224—~2.4kAutomated safety check: NotesApache-2.0
Ad HooksCorridorTech/PoseCap224—~1.7kAutomated safety check: PassApache-2.0
OpenCode Plugin CreatorDevin-AXIS/iPolloWork6.8k1 repos~1.3kAutomated safety check: PassCustom licence

Similar skills

  • Agent Prompts Warmup

    iamtouchskyer/memex

    Audit and sync agent instruction files across all coding agent formats.

    143 GitHub stars~1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Md Starter

    Infrasity-Labs/dev-gtm-claude-skills

    Generates a fully structured, project-specific CLAUDE.md by scanning the repo for signal files (package.json, Makefile, .github/workflows/, .env.example, etc.), inferring stack, commands…

    139 GitHub stars~2k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Ad Hooks

    CorridorTech/PoseCap

    Scaffold deterministic quality gates per WORKFLOW.md §11 — pre-commit (lint, format, secret-scan), pre-push (build, unit, integration).

    224 GitHub stars~2.4k tokensUpdated 2 days ago
    Testing & QAAuto-check: notes
  • Ad Hooks

    CorridorTech/PoseCap

    Scaffold deterministic quality gates per WORKFLOW.md §11 — pre-commit (lint, format, secret-scan), pre-push (build, unit, integration).

    224 GitHub stars~1.7k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • OpenCode Plugin Creator

    Devin-AXIS/iPolloWork

    Scaffolds an OpenCode plugin for iPolloWork with the right async factory shape, zod-based tool definitions and hook registration, and explains where to place and register it.

    6.8k GitHub starsUsed in 1 repo~1.3k tokens
    Agent WorkflowsAuto-check passed
  • Intent Layer

    crafter-station/skills

    Set up hierarchical Intent Layer (AGENTS.md files) for codebases.

    112 GitHub starsUsed in 1 repo~633 tokens
    Agent WorkflowsAuto-check passed

More from k1ein-chen/Harness-Starter

  • Harness Start

    k1ein-chen/Harness-Starter

    Entry point for new users — guides through initialization, architecture review, and cleanup.

    119 GitHub stars~718 tokensUpdated 15 days ago
    Auto-check passed
  • Handover

    k1ein-chen/Harness-Starter

    将当前会话中的技术决策、运维流程或阶段性研发进展,归档为标准工程文档(ADR / SOP / Handover),并自动更新模块内的 README 归档索引。

    119 GitHub stars~752 tokensUpdated 15 days ago
    Auto-check passed
  • Harness Mode

    k1ein-chen/Harness-Starter

    Switch Harness workflow mode (full/hotfix/tweak) and development phase (design/build/fix).

    119 GitHub stars~273 tokensUpdated 15 days ago
    Auto-check: notes
  • Tech Review

    k1ein-chen/Harness-Starter

    Reviews technical decisions before implementation. An agent skill from k1ein-chen/Harness-Starter.

    119 GitHub stars~396 tokensUpdated 15 days ago
    Auto-check passed
  • Verify Goal

    k1ein-chen/Harness-Starter

    Independently verifies whether a completed task meets its defined goal conditions.

    119 GitHub stars~502 tokensUpdated 15 days ago
    Auto-check passed
  • Harness Gc

    k1ein-chen/Harness-Starter

    Garbage Collection Agent — 定期扫描项目健康状态,检测文档/代码一致性漂移,自动发起修复提案。

    119 GitHub stars~360 tokensUpdated 15 days ago
    Auto-check passed

Works with

Categories

Questions about Harness Init

What does Harness Init do?

Initialize this project with the Harness Engineering starter template. Harness Init is an agent skill from k1ein-chen/Harness-Starter. Initialize this project with the Harness Engineering starter template.

When should I use Harness Init?

Harness Init fits situations like: the user wants to set up; reset the Harness configuration.

How do I install Harness Init in Claude Code?

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

How do I install Harness Init in Codex?

Run `npx skills add k1ein-chen/Harness-Starter --skill harness-init -a codex`. Or copy the skill folder (.claude/skills/harness-init in k1ein-chen/Harness-Starter) into .agents/skills/harness-init in your project. Codex loads it when a task matches its description.

Can I use Harness 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 k1ein-chen/Harness-Starter --skill harness-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/harness-init, .gemini/skills/harness-init, .github/skills/harness-init and .opencode/skills/harness-init in your project.

What does Harness Init need to run?

Going by SKILL.md and its folder, Harness Init needs the command-line tools its instructions call (node, git and npm). Our summary lists: Python 3; Node.js.

Does Harness Init access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Harness Init safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Harness Init use?

Harness Init is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Harness Init use?

About 995 tokens (SKILL.md is roughly 4k 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 Harness Init?

Skills that share tags, products or a category with Harness Init: Agent Prompts Warmup (iamtouchskyer/memex, 143 stars), Md Starter (Infrasity-Labs/dev-gtm-claude-skills, 139 stars), Ad Hooks (CorridorTech/PoseCap, 224 stars) and Ad Hooks (CorridorTech/PoseCap, 224 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Harness Init?

k1ein-chen (a GitHub user) maintains it in k1ein-chen/Harness-Starter, which has 119 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 24, 2026.

Source: k1ein-chen/Harness-Starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.