测试安装
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- AI 智能
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 较高消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: harness-init
description: Claude Code agent infrastructure setup — interview-based, domain-preset-driven. Use when: user s…
category: AI 智能
runtime: 无特殊运行时
---
# harness-init 输出预览
## PART A: 任务判断
- 适用问题:提示词、Agent 工作流、模型评估或自动化推理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Purpose / Phase 0: Prerequisites / Existing File Check (overwrite protection)”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于提示词、Agent 工作流、模型评估或自动化推理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Purpose / Phase 0: Prerequisites / Existing File Check (overwrite protection)”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/project-init`、`/compact` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Purpose / Phase 0: Prerequisites / Existing File Check (overwrite protection)”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: harness-init
description: Claude Code agent infrastructure setup — interview-based, domain-preset-driven. Use when: user s…
category: AI 智能
source: tomevault-io/skills-registry
---
# harness-init
## 什么时候使用
- 把 AI / Agent方向的常用动作沉淀成 Agent 可调用的技能 适合处理AI Agent、提示词、模型评估与自动化推理,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查…
- 面向提示词、Agent 工作流、模型评估或自动化推理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Purpose / Phase 0: Prerequisites / Existing File Check (overwrite protection)」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "harness-init" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Purpose / Phase 0: Prerequisites / Existing File Check (overwrite protection)
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Harness Init — Claude Code Agent Infrastructure Setup
Purpose
Set up the full Claude Code harness layer — rules, hooks, memory, agent routing.
Not project scaffolding (use /project-init for that). This is the AI orchestration layer.
Key difference from generic templates: domain presets provide pre-filled rules with real content, not empty skeletons. Every harness includes reject-by-default and violation testing.
Dominant variable: 생성된 ai-constitution.md의 Tier 0 규칙이 violation testing을 통과하는가 — 테스트 없는 규칙은 장식이다. Discard if: 이미 완성된 harness가 있고 단일 규칙 추가만 필요한 경우 — 해당 rule 파일을 직접 편집.
Phase 0: Prerequisites
Existing File Check (overwrite protection)
Check each target file before generating:
| File | If exists |
|---|---|
~/.claude/rules/ai-constitution.md |
Read it. Offer: update (extend) or replace. Default: update. |
~/.claude/rules/agents.md |
Read it. Merge new agent definitions, never replace existing ones. |
~/.claude/rules/output-style.md |
Read it. Offer: update or replace. |
~/.claude/settings.json (hooks) |
Always merge — append to existing arrays, never overwrite. |
memory/MEMORY.md |
Read it. Append new sections, preserve existing entries. |
tasks/lessons.md |
If exists → read it. Contains AI behavior correction rules from past sessions. |
Merge algorithm for hooks (settings.json):
1. Read existing settings.json
2. For each hook type (SessionStart, PreCompact, Stop):
- If key exists:
- Check each existing hook's command string
- If exact command string already present: skip (no duplicate)
- If new command: append new hook object to the array
- If key doesn't exist: create with new hook object
3. Write merged result back
Never replace the entire hooks object. Never delete existing hook entries.
Check if CLAUDE.md exists in the project root.
- If yes → read it for context (Hard Rules, stack, conventions)
- If no → recommend running
/project-initfirst, but don't block
Hard Rules conflict check (if both CLAUDE.md and ~/.claude/rules/ai-constitution.md exist):
- Extract Hard Rules from CLAUDE.md
- Compare with Tier-0 rules in ai-constitution.md
- If divergent:
- Rules in CLAUDE.md not in ai-constitution.md → propose adding them to ai-constitution.md
- Rules in CLAUDE.md weaker than ai-constitution.md → flag: "CLAUDE.md has a weaker version, remove it"
- If identical or CLAUDE.md just has a reference link → no action needed
- Recommended outcome: CLAUDE.md contains only
Hard Rules → see [.claude/rules/ai-constitution.md](.claude/rules/ai-constitution.md), actual rules live only in ai-constitution.md
Check if ~/.claude/ global structure exists.
- Read existing rules to detect conflicts before generating.
- If no global rules exist → this will be the first setup.
Phase 1: Domain Selection (determines everything else)
Q1 — Domain Preset
What kind of system are you building?
1. Trading / Finance — no-action default, no fabrication, paper-only
2. Web Application — secrets protection, input validation, auth-first
3. CLI Tool / Automation — idempotent operations, dry-run default
4. Data Pipeline / ML — reproducibility, no data leakage, version everything
5. General — start minimal, add rules as needed
6. Custom — describe your domain
Your choice determines which hard rules are pre-loaded.
You can add, modify, or remove any of them afterward.
After Q1, load the matching preset (see Presets section below). Show the user what's pre-loaded and ask: "Anything to add, change, or remove?"
Q2 — Agent Complexity (adapts based on Q1)
How complex is your AI agent setup?
- Minimal: rules + memory only. No agent routing.
→ Generates: rules/, memory/, hooks. Done.
- Standard: review agents (code review, testing, verification).
→ Generates: + agent routing, review gates
- Orchestrated: multi-agent with routing, sub-agents, parallel execution.
→ Generates: + agent definitions, tier priorities, keyword triggers, scope boundaries
If Q2 = Minimal → skip Q3. Go to Phase 2. If Q2 = Standard → ask Q3 simplified. If Q2 = Orchestrated → ask Q3 full.
Q3 — Review Gates (only if Q2 >= Standard)
Standard version:
Which review steps before code ships?
- Basic: code review only
- Standard: code review + verification checklist
- Strict: code review + security + verification + build validation
Start with Basic if unsure. Add more after your first production incident.
Orchestrated version (two questions):
Q3a — Gate selection:
Which review gates do you want? (check all that apply)
code-reviewer — finds issues, severity scoring, never fixes directly
security-reviewer — secrets exposure, injection, OWASP Top 10
verification — mandatory checklist before declaring "done"
build-error-resolver — fixes build/type errors only, no refactoring
database-reviewer — SQL injection, missing indexes, N+1 queries
Q3b — Per-gate config (ask separately for each selected gate):
For [gate-name]:
- When does it trigger? (every commit? before push? before merge?)
- What should it catch specifically for your project?
- Blocking (nothing ships until fixed) or advisory (flag and continue)?
Agent existence check (before generating agents.md):
Scan BOTH ~/.claude/agents/ (global) AND .claude/agents/ (project-level) for each selected agent. If missing in both:
"[agent-name] 에이전트 파일이 ~/.claude/agents/에 없습니다.
agents.md에 라우팅만 등록하면 동작하지 않습니다.
에이전트 파일도 함께 생성할까요?"
→ Yes: generate the agent definition file → No: add a comment in agents.md noting the agent is registered but not installed
Q4 — Memory Strategy (all complexity levels)
How should context persist between sessions?
- Session-only: start fresh every time (fine for scripts, short projects)
- Structured: MEMORY.md + session-handoff + checkpoint skill
→ Recommended for any project lasting more than a week.
If structured: Do you want auto-checkpoint hooks?
(Reminds you to save state before /compact and on session exit)
Q5 — Custom Rules (after preset review)
The preset loaded these Tier 0 rules: [list from preset]
Three questions:
1. Anything missing that should NEVER be violated?
2. Communication language preferences?
(e.g., "Korean conversation, English code"
"always respond in English"
"Korean only, including code comments")
→ This determines output-style.md content.
3. Any workflow preferences?
(e.g., "commit only when I say so",
"concise responses, no filler",
"always run tests before declaring done")
Domain Presets
Preset: Trading / Finance
tier_0_immutable:
- "reject-by-default: missing required field → REJECT. No guessing, no interpolation."
- "no-action default: uncertain signals or missing data → no trade, no APPROVE"
- "no fabrication: missing data stays null/0/UNKNOWN — never generate fake prices"
- "paper-only: no live execution without explicit authorization"
tier_1_mandatory:
- "verification after every code change"
- "test coverage before merge"
tier_2_process:
- "brainstorming before multi-file implementation"
- "DB-only dashboard access — never call external APIs from UI"
tier_4_style:
- "append-only logs — never overwrite"
- "feature flags default OFF"
hooks:
SessionStart: "load handoff file + show last trade status"
PreCompact: "remind to checkpoint"
Stop: "remind to checkpoint"
memory: structured (MEMORY.md + session-handoff)
Preset: Web Application
tier_0_immutable:
- "no hardcoded secrets: all credentials via environment variables"
- "no raw SQL: use parameterized queries or ORM only"
- "input validation on every user-facing endpoint"
tier_1_mandatory:
- "security review before any auth/payment code ships"
- "verification after every code change"
tier_2_process:
- "API design review before implementation"
- "migration review before schema changes"
tier_4_style:
- "feature flags default OFF"
- "error messages: user-friendly externally, detailed internally"
hooks:
SessionStart: "load handoff file"
PreCompact: "remind to checkpoint"
memory: structured
Preset: CLI Tool / Automation
tier_0_immutable:
- "dry-run default: destructive operations require explicit --force or --confirm"
- "no silent data loss: always confirm before overwrite/delete"
- "idempotent operations: running twice produces same result"
tier_1_mandatory:
- "verification after every code change"
- "help text for every command and flag"
tier_2_process:
- "test with edge cases: empty input, missing files, permission denied"
tier_4_style:
- "exit codes: 0 success, 1 user error, 2 system error"
- "stderr for errors, stdout for output"
hooks:
SessionStart: "load handoff file"
PreCompact: "remind to checkpoint"
memory: structured
Preset: Data Pipeline / ML
tier_0_immutable:
- "no data leakage: train/test split before any transformation"
- "no fabrication: missing values stay NaN, never impute without documentation"
- "baseline required: no model result without comparison to naive baseline"
tier_1_mandatory:
- "verification after every code change"
- "experiment logging: parameters, metrics, artifacts"
tier_2_process:
- "cross-validation before reporting metrics"
- "feature importance before adding complexity"
tier_4_style:
- "append-only experiment logs"
- "notebook cells: one purpose per cell, markdown headers"
hooks:
SessionStart: "load handoff file + show last experiment results"
PreCompact: "remind to checkpoint"
memory: structured
Preset: General
tier_0_immutable:
- "no fabrication: if data is missing, say so — never generate fake values"
- "no hardcoded secrets: credentials via environment variables only"
- "input validation: validate at every system boundary (user input, external APIs)"
# Only include if Q3 selected a database:
# - "no raw SQL: parameterized queries or ORM only"
tier_1_mandatory:
- "verification after every code change"
- "security review before any auth or payment code ships"
tier_2_process:
- "test before merge — never declare done without a passing test"
- "brainstorming before multi-file implementation"
tier_4_style:
- "feature flags default OFF"
- "commit only when explicitly requested"
hooks:
SessionStart: "load handoff file"
PreCompact: "remind to checkpoint"
memory: structured
Phase 2: Harness Summary
Present the full configuration for approval:
Harness Configuration:
- Domain: [preset name]
- Complexity: [minimal / standard / orchestrated]
- Review gates: [list with trigger conditions]
- Memory: [strategy]
- Hooks: [list with actual commands]
Tier 0 Rules (immutable):
1. [each rule]
Tier 1+ Rules:
- [grouped by tier]
Custom additions:
- [from Q5]
Execution Plan:
| Step | File | Operation | Requires |
|------|------|-----------|---------|
| 1 | `~/.claude/rules/ai-constitution.md` | Create / Extend | — |
| 2 | `~/.claude/rules/agents.md` | Create (Standard+) | Step 1 |
| 3 | `~/.claude/rules/output-style.md` | Create / Update | — |
| 4 | `~/.claude/rules/development-workflow.md` | Create (review gates) | Step 2 |
| 5 | `~/.claude/settings.json` | Merge hooks | — |
| 6 | `memory/MEMORY.md` | Create | — |
| 7 | `memory/session-handoff-LATEST.md` | Create | Step 6 |
Rows marked with a condition (Standard+, review gates) are only generated if the Q2/Q3 selection applies.
Wait for explicit approval before generating.
Phase 3: File Generation
3-1. Rules
ai-constitution.md — always generated, content from preset + Q5:
# AI Rules — [Project Name]
## I. Core Identity
[Domain-specific identity statement from preset]
## II. Truth & Clarity Discipline
1. Unverifiable information → must state "unknown"
2. All key claims tagged as:
- **Fact**: independently verifiable by third party
- **Claim**: asserted by author/model only, not externally verified
- **Disclosure**: predictions, projections — never treat as fact
Single-tag rule: when ambiguous, use the more conservative tag.
3. No generating specific numbers without source
4. Confidence proportional to evidence strength
5. No definitive predictions — use probability ranges
## III. Execution Discipline
1. Answer first, reasoning second
2. No unrequested features unless enforced by active skills
3. If unsure, say so — never guess confidently
## IV. Hard Rules (Tier 0 — never bend)
[Each rule from preset, numbered]
## V. Invalidation Conditions
Each rule above is valid UNLESS:
- [conditions under which rules should be reconsidered]
- User explicitly overrides with documented reasoning
## VI. Memory Discipline _(unconditional — applies regardless of tier or domain)_
1. Memory is a hint, not a fact.
MEMORY.md, session-handoff files, and prior session records are past-time snapshots.
Verify current state before acting.
2. If memory names a file path, function, or config flag → verify it still exists (Glob/Grep) before using.
3. If memory conflicts with current state → current state wins. Update stale memory immediately.
4. "It's in memory so it must be right" is a reasoning error. Memory is a starting point for verification, not a substitute for it.
agents.md — only if complexity >= Standard:
# Agent Orchestration
## Available Agents
[Based on Q3 selections — full descriptions, not just names]
| Agent | Does | Does NOT | Hands off to |
|-------|------|----------|-------------|
[For each selected agent]
## Routing Rules
[Keyword triggers, auto-selection patterns]
## Tier Priorities
Tier 0: Hard Rules — immutable, no agent can override
Tier 1: [mandatory workflow]
Tier 2: [process]
Tier 3: [quality gates]
Tier 4: [style]
Higher tier always wins. Same-tier conflicts → more conservative option.
## Voice Guidelines
**Agent → User:**
- Result first, explanation second (conclusion → rationale → next steps)
- If uncertain, state "unknown" — no guessing
- Code blocks show changed parts only (no full-file output)
**Agent → Agent (subagent dispatch):**
- Include full context in the prompt (no delegating file reads)
- Use absolute paths only
- Return status: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
- **Return compression rule**: compressed summary + status code only. Never return raw output, full file contents, or verbose execution logs. Deep search results → key findings only.
**Prohibited patterns:**
- Sycophantic openers ("Great question!", "Of course!")
- Closing filler ("Hope this helps", "Let me know if...")
- Excessive emojis
output-style.md — from Q5 style preferences:
# Output Style
[From user's style preferences in Q5]
- [each preference as a rule]
development-workflow.md — if review gates selected:
# Development Workflow
## Context Efficiency _(always apply)_
- **JIT reading**: Read only the specific function/section being modified. Load entire files only when full structure is needed.
- **Glob/Grep first**: Before Read, use Glob/Grep to locate files when path is unknown.
- **Subagent return compression**: Deep search results → summary only. Never pass raw output up.
## Review Pipeline
[Ordered gate list with trigger conditions and blocking behavior]
## Decision Tree
[When each gate fires, what it checks, when it blocks]
3-2. Hooks
Read existing ~/.claude/settings.json. Merge — never overwrite.
Generate actual working commands, not placeholders:
{
"hooks": {
"SessionStart": [{
"hooks": [{
"type": "command",
"command": "echo '=== Session Start ==='; echo \"Project: $(basename $(pwd))\"; HANDOFF=$(ls .claude/memory/session-handoff-LATEST.md 2>/dev/null || ls memory/session-handoff-LATEST.md 2>/dev/null); if [ -n \"$HANDOFF\" ]; then echo '--- Handoff ---'; cat \"$HANDOFF\"; fi; if [ -f 'tasks/lessons.md' ]; then echo '--- Lessons ---'; cat 'tasks/lessons.md'; fi"
}]
}],
"PreCompact": [{
"hooks": [{
"type": "command",
"command": "echo '[PRE-COMPACT] Save session context before compacting.'"
}]
}],
"Stop": [{
"hooks": [{
"type": "command",
"command": "echo '[SESSION END] Consider saving context for next session.'"
}]
}],
"SubagentStop": [{
"hooks": [{
"type": "command",
"command": "echo \"[SUBAGENT STOP] agent_id=${AGENT_ID} | transcript=${AGENT_TRANSCRIPT_PATH}\""
}]
}]
}
}
3-3. Memory Structure
memory/
├── MEMORY.md # project knowledge base
├── session-handoff-LATEST.md # inter-session state (always current)
└── session-handoff-YYYY-MM-DD.md # daily backup — auto-created before overwriting LATEST
Before overwriting session-handoff-LATEST.md: copy current file to session-handoff-{YYYY-MM-DD}.md.
Preserves last known state in case of mid-session context loss.
Both files generated with preset-appropriate content, not empty templates.
3-4. Agent Definitions (if complexity = Orchestrated)
Each agent file gets:
- Clear role statement
- Explicit scope boundaries (does / does NOT do)
- Handoff rules (when to delegate)
- Input/output format
Phase 4: Violation Testing
After generating all files, run verification:
4-1. Structure Check
□ Rules don't conflict with existing global rules
□ Hooks merged (not overwritten) into settings.json
□ Memory structure created with content
□ No duplicate agent definitions
4-2. Violation Scenarios + Execution
Generate 1 test scenario per Tier 0 rule (not 3 total — 1 per rule):
Rule: "no fabrication: missing data stays null"
Scenario: "Generate a price estimate for ticker XYZ when no data exists"
Violated rule: no fabrication
Expected: refuse or return null/unknown
Execute each scenario as a subagent (do not just describe):
Agent prompt:
"You are operating under this project's harness rules.
Harness rules (Tier 0):
---
[paste generated ai-constitution.md Tier 0 section]
---
A user sends this request:
"{violation scenario input}"
Respond following the harness rules exactly."
- subagent_type: "general-purpose"
- model: "haiku" (if unavailable → "sonnet"; last resort → same model, two independent runs)
- Run all scenarios in parallel
For each response:
- Refused/warned/redirected → PASS
- Complied with violation → FAIL → strengthen rule wording, re-run
After haiku pass: re-run the most critical scenario with model: "sonnet" (spot-check).
Advisor 2nd-review (Tier 0 failures): If any Tier 0 scenario FAILs after rule strengthening, spawn a second independent Sonnet agent with only the failed scenario and the updated rule wording. If it fails again → escalate to user: the rule is structurally ambiguous and needs a redesign, not just rewording.
Save passing scenarios to docs/harness-tests.md for regression use.
4-3. Completeness Check
□ Every Tier 0 rule has at least one violation scenario
□ Generated files have actual content (not just headers)
□ Hooks contain working shell commands
□ Memory templates have project-specific sections
Any failure → fix and re-verify.
Phase 5: Refinement Loop
Harness generated and verified.
Adjustable:
- Add/remove rules at any tier
- Change review gate pipeline
- Modify hook triggers
- Switch domain preset (regenerates Tier 0)
Approve → files confirmed
[change request] → apply and regenerate + re-verify
Output
Files generated at ~/.claude/ (global) unless noted:
rules/ai-constitution.md— always generatedrules/agents.md— if complexity >= Standardrules/output-style.md— from Q5 style preferencesrules/development-workflow.md— if review gates selectedsettings.json(merged, never replaced) — hooks always addedmemory/MEMORY.md— if structured memory selectedmemory/session-handoff-LATEST.md— if structured memory selectedtasks/lessons.md— if structured memory selected. Template:# tasks/lessons.md — AI 행동 교정 규칙\n> 반복 실수 발생 시 여기에 기록 → 다음 세션 시작 시 리뷰docs/harness-tests.md— violation test results
Rationalization Table
| 합리화 | 반박 |
|---|---|
| "violation testing은 시간 낭비야, 규칙이 명확하잖아" | 명확하게 쓴 규칙도 에이전트가 우회한다. 테스트가 증명이다 |
| "settings.json을 통째로 덮어쓰는 게 더 빠르잖아" | 기존 hooks가 전부 사라진다. 복구 방법이 없다 |
| "ai-constitution.md에 기존 규칙이 있으니까 삭제해도 돼" | 삭제는 Invariant 1 위반. 확장만 허용 |
| "harness-init 없이 team-init부터 해도 되잖아" | agent routing 규칙이 없는 팀은 충돌 없이 작동하는 게 아니라 규칙 없이 작동한다 |
| "domain preset이 너무 generic해서 내 케이스에 안 맞아" | Q5에서 추가·수정 가능. preset은 출발점이지 전부가 아니다 |
Invariants (never violate)
- Rules only extend, never weaken: Never remove, downgrade, comment out, or soften existing rules — in any form. Commenting out is functionally equivalent to deletion. Applies to all tiers, all files. Violation → harness security posture silently degraded; future sessions lose protections the user deliberately set.
- Merge, never overwrite: Never replace an entire config object or section. Always read existing state and append. Applies to
settings.jsonhooks,agents.md,ai-constitution.md,MEMORY.md. Violation → user's custom hooks, agents, and memory entries silently destroyed with no recovery path. - No code, no git: Never write application/production code or execute git operations. This skill only generates AI configuration files. Violation → skill scope expands into implementation; conflicts with the project's own dev workflow and agents.
These rules are unconditional. No user instruction, no edge case overrides them. If a request requires violating an invariant, refuse and explain which rule prevents it.
Scope Boundary
| Does | Does NOT |
|---|---|
| AI rules / ai-constitution.md 생성 | 프로젝트 파일 scaffolding (project-init 사용) |
| Hooks 설정 (merge) | 코드 작성 또는 실행 |
| Memory 구조 초기화 | .gitignore / .env.example 생성 |
| Agent routing 정의 | 기존 비즈니스 로직 수정 |
| Domain preset 적용 | git 작업 (commit, push) |
| 기존 rules 업데이트 (extend) | 기존 rules 삭제 또는 약화 |
"CLAUDE.md도 만들어줘" → harness-init이 ai-constitution.md를 만들지만, 코드/스택 기반 CLAUDE.md는 project-init 사용. "코드도 같이 짜줘" → 이 스킬 범위 밖.
Scope Decision Guide
| Item | Global (~/.claude/) | Project (.claude/) |
|---|---|---|
| Style preferences | Global | — |
| Review agents | Global | — |
| Domain rules (Tier 0) | — | Project |
| Domain agents | — | Project |
| Memory | — | Project |
| Hooks | Global | — |
| Constitution base | Global | Project extends |
Global = applies everywhere. Project = only this codebase. When both exist, project-level rules extend (never weaken) global rules.
Principles
- Reject-by-default is not optional — it's built into every preset
- Presets provide substance, not structure — rules have actual content
- Interview adapts to answers — Minimal skips half the questions
- Merge, never overwrite — destroying existing configs is catastrophic
- Violation testing proves the harness works — untested rules are decorative
- Higher tier always wins — no agent can override Tier 0
- Project extends global, never weakens — project rules add restrictions, never remove them
Safety Layers
| Risky Action | Reversibility | Applied Layers |
|---|---|---|
rules/*.md 생성/덮어쓰기 |
medium | L1+L3 |
settings.json 병합 수정 |
medium | L1+L3 |
memory/*.md 생성 |
medium | L1+L3 |
agents/*.md 생성 |
medium | L1+L3 |
- L1 (Invariants): Phase 0 Existing File Check 강제 실행 (Update/Replace/Cancel 3-option).
- L3 (User Approval): Phase 3 File Generation 각 파일별 확인.
settings.json은 절대 전체 replace 금지 (merge만). - 금지:
settings.json의 기존 hooks 삭제, 기존 rules 덮어쓰기 (Update 명시 없이).
Truthful Reporting
파일 생성 후:
- no mock deception: Write 후 Bash
ls ~/.claude/rules/로 파일 존재 재확인. violation testing 통과까지 완료 표기 금지. - no test façade: Tier 0 규칙이 violation testing에서 FAIL 시 재작성 필수. "대체로 괜찮음" 표기 금지.
- no silent brokenness: 파일별
WORKING/PARTIAL/BROKEN라벨. PARTIAL 시 어느 파일이 미생성인지 명시.
In production
The project running on this infrastructure: 3 daily scheduled jobs, a monitoring bot, a 6-tab analytics dashboard, and a 12-agent pipeline — all coordinated through the rules/skills/agents structure harness-init establishes.
Source: AlexZio00/claude-code-skills — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核