Skip to content

feat: Claude Code harness engineering Phase 1 + Phase 2#38

Merged
aimsise merged 4 commits intomainfrom
feat/harness-engineering-phase1-phase2
Apr 2, 2026
Merged

feat: Claude Code harness engineering Phase 1 + Phase 2#38
aimsise merged 4 commits intomainfrom
feat/harness-engineering-phase1-phase2

Conversation

@aimsise
Copy link
Copy Markdown
Owner

@aimsise aimsise commented Apr 2, 2026

Summary

Claude Code のハーネスエンジニアリング Phase 1 + Phase 2 を実装。
ハーネス5原則(Constrain, Inform, Verify, Correct, Human-in-the-loop)を全てカバー。

Phase 1: Foundation Strengthening

  • T-004/T-003/T-005: Agent hardening (maxTurns, Bash制限, permissionMode)
  • T-006: 4つのドメイン知識スキル作成 (Progressive Disclosure)
  • T-001/T-002: CLAUDE.md重複解消 + Agent Project Context → skills: プリロード移行
  • T-016: 15 commands → skills 移行 (disable-model-invocation, context: fork, allowed-tools)

Phase 2: Workflow Evolution

  • T-007: Hooks導入 (pre-bash-safety, post-edit-lint, security-check, syntax-check, session管理)
  • T-011: Generator-Evaluator ループ (/refactor の自動レビュー反復)
  • T-012: SessionStart フックによる自動コンテキスト復元
  • T-009: /phase-clear フェーズ自動検出

File Changes

  • New: 25 skill files, 7 hook scripts, 1 settings.json
  • Modified: 6 agents, CLAUDE.md, workflow-patterns.md
  • Deleted: 15 command files + .claude/commands/ directory

Test plan

  • /commit など disable-model-invocation スキルが自動発火しないこと
  • /investigate, /test, /plan2doc が context: fork で動作すること
  • Hooks: rm -rf がブロックされること
  • Hooks: .py 編集後に ruff lint フィードバックが返ること
  • SessionStart でブランチ情報が注入されること
  • /refactor の Gen-Eval ループが動作すること
  • /phase-clear 引数なしでフェーズ自動検出されること

🤖 Generated with Claude Code

Helix and others added 4 commits April 2, 2026 13:21
Migrate Claude Code setup from commands-based to skills-based architecture
with Progressive Disclosure, agent hardening, and context deduplication.

Wave 1 - Agent Hardening:
- T-004: Add maxTurns to all 6 agents (20-40 range)
- T-003: Restrict researcher Bash to git-only
- T-005: Set permissionMode: acceptEdits for doc-writer, test-writer, planner

Wave 2 - Domain Knowledge Skills:
- T-006: Create 4 background skills (seedbraid-conventions, sbd1-format,
  security-guidelines, test-patterns) with references/ subdirectories

Wave 3 - Cleanup and Migration:
- T-001: Remove CLAUDE.md Reference Docs covered by skills/rules
- T-002: Replace agent Project Context with skills: preloading
- T-016: Migrate all 15 commands to skills with disable-model-invocation,
  context: fork, allowed-tools, and model overrides; delete .claude/commands/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r allowed-tools

- commit: add Bash(git log:*) to allowed-tools for dynamic context
  `!git log --oneline -10` which fetches recent commits for style reference
- phase-clear: simplify to Bash(git:*) to match plan specification

Found by code-reviewer agent review against plan file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add hooks infrastructure, generator-evaluator loop, session management,
and phase auto-detection to complete the Verify and Correct harness layers.

T-007 Hooks (3 steps):
- Step 1: pre-bash-safety.sh (block destructive commands via exit 2)
         post-edit-lint.sh (ruff feedback on .py edits)
- Step 2: pre-write-security-check.sh (warn on security-sensitive files)
         post-edit-syntax-check.sh (ast.parse syntax validation)
- Step 3: session-start.sh (additionalContext injection)
         pre-compact-save.sh (work state snapshot)
         session-stop-log.sh (session end logging)

T-011 Generator-Evaluator Loop:
- Refactor skill now runs plan → approve → loop(implement → test/lint →
  code-review → fix, max 3 iterations) → report

T-012 SessionStart Hook:
- Injects branch, changed files, active feature, latest plan on session start

T-009 Phase Auto-Detection:
- phase-clear auto-detects current phase from git state and .docs/ contents

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All other hook scripts (pre-compact-save.sh, session-stop-log.sh) consume
stdin before processing. session-start.sh was missing this, which could
cause issues with set -euo pipefail if the hook receives piped input.

Found by code-reviewer agent review against plan file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aimsise aimsise merged commit c2a9924 into main Apr 2, 2026
6 checks passed
@aimsise aimsise deleted the feat/harness-engineering-phase1-phase2 branch April 2, 2026 05:06
@aimsise aimsise mentioned this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant