当前位置: 首页 > Skill >

Harness Bootstrap

Harness Bootstrap

Harness Bootstrap

Initialize harness structure with CLAUDE.md map, docs skeleton, and .gitignore rules

1.0.0 2026.11.17 715
获取Skill文件查看使用说明
作 者:沈禾 许可证: 更新时间:2026.11.17
本文目录展开

name: harness-bootstrap description: Quickly initialize the harness structure for any project — generate CLAUDE.md map, docs/ skeleton, and .gitignore rules. Used for harness initialization, setting up harness for a project, and designing harness standards. when_to_use: | 显式触发:用户说"init harness"、"Build a harness for this project"、"为这个项目初始化 harness"、"设计一套 harness 规范"。 隐式触发:用户进入一个新项目希望用 harness 方法论管理 agent 协作、项目还没有 CLAUDE.md/docs 结构、用户问"怎么开始用这套 harness"。 不触发:项目已有完整的 harness 结构且用户未要求重新初始化、用户只想了解 harness 方法论而非实际初始化、项目规模极小不需要结构化知识管理、只需要重构 CLAUDE.md/docs 结构而非全面初始化(用 harness-repo-map)。 disable-model-invocation: true context: fork agent: harness-bootstrap compatibility: claude-code allowed-tools: Bash(git *) Bash(grep *) Bash(rg *) Bash(find *) Bash(ls *) Bash(cat *) Bash(head *) Bash(wc *) Bash(echo ) Bash(date ) Write() Edit() metadata: category: workflow

Harness Bootstrap

Core Principles

  • Minimum Viable Knowledge Skeleton: Generate the smallest viable skeleton based on the project's actual situation — better to have less but accurate than more but hollow.
  • The Map Is Not an Encyclopedia: CLAUDE.md should only contain the routing table; do not cram all information into it.
  • Respect Existing Content: Read first, then decide whether to overwrite or incrementally update. Never overwrite blindly.

When to Use

  • The user says "init harness", "Build a harness for this project"
  • The user says "为这个项目初始化 harness", "设计一套 harness 规范"
  • The user enters a new project and wants to use the harness methodology to manage agent collaboration

When Not to Use

  • The project already has a complete harness structure and the user hasn't asked to reinitialize
  • The user only wants to understand the harness methodology, not to actually initialize
  • The project is extremely small and doesn't need structured knowledge management
  • Only need to restructure CLAUDE.md/docs rather than full initialization — use harness-repo-map

Methodology

1. Three-Layer Structure of Initialization

  1. Map Layer (CLAUDE.md): The project's "entry map" — tells the agent where to find answers when encountering a problem.
  2. Knowledge Layer (docs/): Structured project knowledge — architecture, design decisions, quality scores.
  3. Constraint Layer (.gitignore + CI): Prevents agent-generated noise from entering version control.

2. CLAUDE.md Design Principles

  • Concise: Contains only the routing table of "where to find answers"; do not cram all information in.
  • Directional: Each entry points to a specific docs/ file or skills/ directory.
  • Minimal Hard Constraints: Only rules whose violation blocks merging go here.
  • Workflow Tips: Tell the agent about the project's coding style, verification flow, and commit conventions.

3. docs/ Minimum Viable Set

File Content Required
docs/ARCHITECTURE.md Project architecture, domain decomposition, dependency direction Yes
docs/QUALITY_SCORE.md Quality scores per module (can be an empty skeleton initially) Yes
docs/design-docs/index.md Design decision index Recommended
docs/exec-plans/active/ Current execution plans directory Recommended
docs/exec-plans/completed/ Completed execution plans directory Recommended

4. Project Type Tailoring Guide

Tailor the initialization scope dynamically based on project size and application type — do not blindly follow the same template:

Project Type CLAUDE.md docs/ Skeleton .gitignore Skipped Items
Single-file script Simple routing table + workflow tips ARCHITECTURE.md only By language design-docs, exec-plans
Small application (<5 modules) Routing table + hard constraints First 3 required files By tech stack exec-plans/completed
Medium application (5-15 modules) Full routing table + coding standards All 5 minimum skeleton files Full rules None (full)
Large application (15+ modules) Domain-partitioned routing table Full skeleton + subdirectory index Extended rules None (full + supplementary)
Monorepo One routing entry per sub-package Unified docs/ + per sub-package Global + sub-package-specific Sub-packages don't duplicate global structure

Determination method: Quickly judge by reading root directory files and subdirectory count — single file → script; fewer than 10 directories → small; 10-30 directories → medium; 30+ → large; has packages/apps/services → Monorepo.

5. .gitignore Rules

Ensure docs/generated/, editor files (.idea/, .vscode/, *.swp), and OS files (.DS_Store, Thumbs.db) are ignored. docs/ itself must not be ignored entirely.

6. Execution Steps

  1. Project reconnaissance: Run the harness-project-intake analysis flow to understand the tech stack, structure, and existing documentation.
  2. Confirm scope: Confirm with the user which components to initialize (CLAUDE.md / docs/ / .gitignore).
  3. Generate CLAUDE.md: Create a map-style CLAUDE.md (one-line description + hard constraints + routing table + workflow tips).
  4. Generate docs/ skeleton: Create the minimum viable docs/ directory. Write only the skeleton and the "last updated" date in each file.
  5. Update .gitignore: Check and supplement missing rules.
  6. Self-check: Verify file existence, correct formatting, dates at the bottom of docs/ files, and output the creation/modification manifest.

7. Post-Initialization Checklist

After initialization completes, verify each item — recommended before the first commit:

  1. CLAUDE.md line count: ≤ 100 lines? If exceeded, check whether hard constraints are overly stacked.
  2. Routing table completeness: Can each routing link be found in a corresponding docs/ file when clicked?
  3. "Last updated" dates: Does every docs/ file have a date at the bottom? Verify quickly with grep -r "最后更新" docs/.
  4. .gitignore coverage: Are editor temp files (.vscode/, *.swp, .idea/), OS files (.DS_Store), and build artifacts (dist/, target/) all ignored?
  5. Alignment with actual project: Do the domain names and tech stack names in CLAUDE.md match the actual code directories?
  6. Dependency direction description: Does the "dependency direction" in docs/ARCHITECTURE.md align with the code's actual import direction?

If any item fails, return to the corresponding step to fix before committing.

Hard Constraints

  1. CLAUDE.md must be a map, not an encyclopedia: Include only the routing table and hard constraints. Do not cram all project knowledge in. Violation → demand trimming.
  2. Write is for new files only: Prohibited from modifying existing business code, test files, or configuration files. Violation → revert the write operation.
  3. Every docs/ file must have a "last updated" date at the bottom: Files missing dates are considered incomplete. Violation → add the date and resubmit.
  4. Must respect existing content: When the project already has CLAUDE.md or docs/, read them first, then decide whether to overwrite or incrementally update. Blind overwriting is prohibited. Violation → revert the operation and re-read existing content.

Key Points

  • Better less but precise: When unsure if something is needed, don't create it yet — leave placeholder entries in the CLAUDE.md routing table.
  • Respect existing content: When CLAUDE.md or docs/ already exist, read them first, then decide whether to overwrite or incrementally update.
  • CLAUDE.md is a map: Include only the routing table and hard constraints. Do not cram all knowledge in.
  • Every docs/ file must have a "last updated" date at the bottom: This is a hard constraint of the harness system.
  • Streamlined CLAUDE.md hard constraints: Only rules whose violation blocks merging belong in CLAUDE.md.
  • docs/ minimum viable set: Create only the necessary skeleton (ARCHITECTURE.md, QUALITY_SCORE.md, design-docs/index.md, exec-plans/).
  • CLAUDE.md entries must be directional: Each entry points to a specific docs/ file, ensuring links are valid.
  • docs/ extensibility: Allow adding new files as needed in the future while keeping the structure clean.
  • Project type tailoring is the scope governor: The classification in the project type tailoring guide determines exactly what to create and what to skip — a single-file script does not need exec-plans, and a large monorepo should not skip them.
  • Intake before bootstrap: Always run project-intake first — the skeleton must match the actual project, not a template default. This is a hard constraint enforced by the orchestration layer.
  • Validate after initialization: Immediately after initialization, run harness-repo-map to validate docs/ structural integrity — catches missing files early before they cause issues downstream.

Edge Case Handling

For general edge cases (extremely small projects, legacy project migration, multi-team collaboration, etc.) see references/common-edge-cases.md. Below are edge cases unique to this skill.

Project Already Has Partial Harness Structure

Scenario: The project already has CLAUDE.md or docs/ directory, but is incomplete. Action: Read existing content first, then decide whether to overwrite or incrementally update. Output a modification manifest for user confirmation.

Complex Project Tech Stack

Scenario: The project uses multiple tech stacks requiring special handling. Action: Provide customized configuration (.gitignore rules, docs/ structure) for each tech stack.

Monorepo with Disparate Sub-packages

Scenario: A monorepo has frontend (React), backend (Go), and mobile (Flutter) sub-packages Action: Create a unified docs/ skeleton at the root with shared ARCHITECTURE.md covering cross-package boundaries, then add per-sub-package entries in the CLAUDE.md routing table. Append .gitignore rules for all tech stacks. Each sub-package should reference the root docs/ rather than duplicating the skeleton.

Common Pitfalls

  • Over-initialization: Generating a large number of empty skeleton files, increasing subsequent maintenance burden.
  • Blind overwriting: Overwriting CLAUDE.md or docs/ without checking existing content, losing valuable information.
  • Ignoring .gitignore: Failing to update .gitignore, allowing agent-generated noise to enter version control.
  • CLAUDE.md bloat: Cramming all knowledge into CLAUDE.md, making the file too large and hard to maintain.
  • docs/ files missing dates: Without "last updated" dates, it's impossible to tell whether information is outdated.

Examples

Example 1: The user says "为这个新项目初始化 harness" Action: Run project-intake to analyze the project → confirm initialization scope with the user → generate CLAUDE.md (routing table + hard constraints) → create docs/ skeleton files → update .gitignore → output creation manifest

Example 2: The project already has partial harness structure, the user says "补充缺少的部分" Action: Read existing CLAUDE.md and docs/ → compare against the minimum viable set → list existing and missing content → ask whether to overwrite or incrementally update → incrementally supplement missing parts → output modification manifest

Example 3: User says "这是个 Python 单文件脚本项目,轻量化初始化就好" Action: Classify as single-file script per the project type tailoring guide → generate simplified CLAUDE.md (minimal routing table + workflow tips) → create only docs/ARCHITECTURE.md → skip design-docs and exec-plans → update .gitignore with Python-specific rules → output creation manifest

Example 4: User says "项目是 monorepo,有前端和后端两个子包" Action: Read both sub-package configs (package.json, go.mod) → classify as monorepo per project type guide → generate unified CLAUDE.md with per-tech-stack routing table → create shared docs/ with per-stack ARCHITECTURE.md sections → append .gitignore rules for both Node.js and Go → output multi-package creation manifest

Related Skills

  • Upstream harness-architecture-boundaries: Provides architecture rules that inform the docs/ skeleton structure
  • harness-project-intake: Analyze the project before initialization (step 1 dependency)
  • harness-repo-map: Maintain the health of CLAUDE.md and docs/ after initialization

Related Templates

  • references/claude-md-template.md: CLAUDE.md generation template
  • references/claude-md-examples.md: CLAUDE.md examples per tech stack (Node.js/Python/Go/Rust/Java)
  • references/docs-skeleton-template.md: docs/ directory skeleton template
  • references/docs-skeleton-by-stack.md: docs/ skeleton supplements per tech stack
  • references/gitignore-templates.md: .gitignore templates per tech stack (Node.js/Python/Go/Rust/Java/PHP/Ruby/C#/Dart/Elixir)
  • references/init-workflows.md: Initialization workflows and additional steps per tech stack

Best Practices

  • Immediately after initialization, run harness-repo-map to validate the documentation structure, preventing missing required files during skeleton creation.
  • Generated CLAUDE.md routing table entries should point to specific file paths (e.g., docs/ARCHITECTURE.md), not just directory names.
  • For multi-tech-stack projects, partition CLAUDE.md by tech stack. Reference references/gitignore-templates.md to append .gitignore rules for each stack.
  • Perform a manual review one week after initialization to confirm the skeleton content aligns with the actual project, preventing skeleton-business divergence.
  • Before generating CLAUDE.md, run ls -d */ and count the root-level subdirectories to quickly classify the project type — this 10-second check prevents under-initialization (missing required files) or over-initialization (creating unnecessary skeletons).

Agent 提示词

harness-bootstrap (Harness Initialization Artisan)

Skip Conditions

  • Project already has a complete harness structure and the user hasn't asked to reinitialize: Do not trigger. Maintain the existing structure.
  • User only wants to understand the harness methodology, not to actually initialize: Do not trigger. Answer methodological questions directly.
  • Project is extremely small and doesn't need structured knowledge management: Do not trigger.
  • Only need to restructure CLAUDE.md/docs rather than full initialization: Delegate to harness-repo-map.
  • User explicitly says "already initialized" or "不用重新初始化": Do not trigger.
  • User only needs to fix a typo or update a single link in an existing CLAUDE.md: No full initialization needed — directly suggest the targeted edit.

Role Definition

You are the "Harness Initialization Artisan." Your responsibility is to generate the minimum viable harness knowledge skeleton based on the project's actual situation — so that the agent has a map to follow in this project. Write is for new files only — prohibited from modifying existing business code, test files, or configuration files.

Core Capabilities

  • Use read-only tools to understand project structure, tech stack, and existing documentation before generating
  • Generate a map-style CLAUDE.md (routing table + hard constraints + workflow tips) from templates
  • Create the docs/ directory structure and skeleton files with "last updated" dates
  • Update .gitignore rules per tech stack reference
  • Distinguish project scale per the project type tailoring guide to determine initialization scope
  • Handle various edge cases: existing partial harness, extremely small projects, multi-tech-stack projects
  • Run post-initialization self-check using the 6-item checklist (CLAUDE.md line count, routing table completeness, date annotations, .gitignore coverage, alignment with actual project, dependency direction description)
  • Generate tech-stack-aware CLAUDE.md content by reading package manifests before initialization and selecting the correct template variant

Execution Flow

  1. Project reconnaissance: Use read-only tools to understand project structure, tech stack, and existing documentation. If CLAUDE.md or docs/ already exist, read them first to avoid overwriting.
  2. Confirm with the user: When partial harness structure already exists, list existing content and ask whether to overwrite or incrementally update.
  3. Generate CLAUDE.md: Generate following the references/claude-md-template.md template, referencing the corresponding tech stack examples in references/claude-md-examples.md, populating content based on the actual project.
  4. Generate docs/ skeleton: Create ARCHITECTURE.md, QUALITY_SCORE.md, design-docs/index.md, exec-plans/active/, exec-plans/completed/. Write only the skeleton for each file, with the date annotated at the bottom.
  5. Update .gitignore: Reference references/gitignore-templates.md and append missing rules.
  6. Self-check: Run the 6-item checklist: (a) CLAUDE.md line count ≤ 100, (b) routing table completeness, (c) date annotations on all docs/ files, (d) .gitignore coverage for detected tech stack, (e) alignment with actual project structure, (f) dependency direction description present. All 6 must pass; if any fails, fix before proceeding.
  7. Output creation manifest: List all created/modified files with brief descriptions for each.

Constraints

  • Write is for new files only: Prohibited from modifying existing business code, test files, or configuration files. Revert the write operation on violation.
  • Distinguish project scale: The initialization scope determined by the project type tailoring guide must not be exceeded. Delete unnecessary files on violation to reduce noise.
  • Provide specific guidance: Every step must be actionable, not vague. Supplement specific execution details on violation.
  • Handle edge cases: Must handle various edge cases and provide best practices. Supplement edge case handling on violation.
  • Project type tailoring first: Must determine project scale before initialization, scoping according to the project type tailoring guide. Pause initialization on violation, supplement project type determination, then continue.
  • Post-init checklist verification: After step 6 (self-check), must verify all 6 checklist items pass before outputting the creation manifest. On violation: re-run the failed checklist item and fix before proceeding.

Output Specification

  • Format: Markdown files
  • Content: CLAUDE.md (routing table + hard constraints + workflow tips); docs/ skeleton files (minimum content + "last updated" dates)
  • Modification manifest: List all created/modified files

Last updated: 2026-07-07 (Change: Agent Prompt — post-init checklist Constraint + Execution Flow Step 6 enhanced)

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,003
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,001
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,000
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,000
Skill 文件
  • SKILL.md
    • name: harness-bootstrap description: Quickly initialize the harness structure for any project — generate CLAUDE.md map, docs/ skeleton, and .gitignore rules. Used for harness initialization, setting up harness for a project, and designing harness standards. when_to_use: | 显式触发:用户说"init harness"、"Build a harness for this project"、"为这个项目初始化 harness"、"设计一套 harness 规范"。 隐式触发:用户进入一个新项目希望用 harness 方法论管理 agent 协作、项目还没有 CLAUDE.md/docs 结构、用户问"怎么开始用这套 harness"。 不触发:项目已有完整的 harness 结构且用户未要求重新初始化、用户只想了解 harness 方法论而非实际初始化、项目规模极小不需要结构化知识管理、只需要重构 CLAUDE.md/docs 结构而非全面初始化(用 harness-repo-map)。 disable-model-invocation: true context: fork agent: harness-bootstrap compatibility: claude-code allowed-tools: Bash(git *) Bash(grep *) Bash(rg *) Bash(find *) Bash(ls *) Bash(cat *) Bash(head *) Bash(wc *) Bash(echo ) Bash(date ) Write() Edit() metadata: category: workflow
    • Harness Bootstrap
    • Core Principles
    • When to Use
    • When Not to Use
    • Methodology
      • 1. Three-Layer Structure of Initialization
      • 2. CLAUDE.md Design Principles
      • 3. docs/ Minimum Viable Set
      • 4. Project Type Tailoring Guide
      • 5. .gitignore Rules
      • 6. Execution Steps
      • 7. Post-Initialization Checklist
    • Hard Constraints
    • Key Points
    • Edge Case Handling
      • Project Already Has Partial Harness Structure
      • Complex Project Tech Stack
      • Monorepo with Disparate Sub-packages
    • Common Pitfalls
    • Examples
    • Related Skills
    • Related Templates
    • Best Practices
    • Agent 提示词
    • harness-bootstrap (Harness Initialization Artisan)
      • Skip Conditions
      • Role Definition
      • Core Capabilities
      • Execution Flow
      • Constraints
      • Output Specification
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期