feat: Claude Code harness engineering Phase 1 + Phase 2#38
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Claude Code のハーネスエンジニアリング Phase 1 + Phase 2 を実装。
ハーネス5原則(Constrain, Inform, Verify, Correct, Human-in-the-loop)を全てカバー。
Phase 1: Foundation Strengthening
Phase 2: Workflow Evolution
File Changes
Test plan
/commitなど disable-model-invocation スキルが自動発火しないこと/investigate,/test,/plan2docが context: fork で動作することrm -rfがブロックされること/refactorの Gen-Eval ループが動作すること/phase-clear引数なしでフェーズ自動検出されること🤖 Generated with Claude Code