Skip to content

Conversation

@Data-Wise
Copy link
Owner

Summary

  • Teaching Ecosystem Coordination (PR feat: teaching ecosystem coordination #57): Config normalizer (_normalize_config()), single-day break support, 8 normalization tests, dedicated Teaching docs tab
  • Branch Protection Hooks (PR feat: branch protection hooks (v2.16.0) #58): scripts/branch-guard.sh PreToolUse hook, block-all/block-new-code protection levels, bypass marker, dry-run mode, 138 tests (49 unit + 31 e2e + 6 integration + 52 dogfooding)
  • Docs cleanup: Archived 23 specs to _archive/, fixed 12+ broken spec links, removed stale brainstorm gitignore
  • Test count: 1294 → 1432 (+138 branch-guard tests)
  • Command count: 106 → 108 (+protect, +unprotect)

New Commands

Command Purpose
/craft:git:protect Re-enable branch protection
/craft:git:unprotect Temporary bypass via marker file

Branch Protection Levels

Level Branch Blocks Allows
block-all main All writes, edits, commits Read-only
block-new-code dev New .py/.sh/.js/.ts/.json/.yml Existing files, docs, specs, tests

Test plan

  • Pre-release check passes (scripts/pre-release-check.sh 2.16.0)
  • Core tests: 13/13 passing (test_craft_plugin.py)
  • Branch guard unit: 49/49 passing (test_branch_guard.sh)
  • Branch guard e2e: 31/31 passing (test_branch_guard_e2e.sh)
  • Branch guard integration: 6/6 passing (test_integration_branch_guard.py)
  • Branch guard dogfooding: 51/52 passing, 1 expected skip (test_branch_guard_dogfood.py)
  • Teaching integration: 16/16 passing (test_integration_teaching_workflow.py)
  • All pre-commit hooks pass (markdownlint, CRAFT-001, budget check)

🤖 Generated with Claude Code

Test User and others added 17 commits February 6, 2026 11:24
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- REFCARD: version 2.14.0→2.15.0, tests 1248→1286, feature highlight
- CHANGELOG: add v2.15.0 entry (spec simplification + smart questions)
- claude-md.md: version ref 2.14.0→2.15.0
- first-10-minutes tutorial: version in example output
- TEST-CONVENTIONS, cookbook, check-mastery: test count 1248→1286

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two design specs from brainstorm sessions:
- Branch protection hooks (PreToolUse enforcement for dev/main)
- Teaching ecosystem coordination (Craft + Scholar + Flow-CLI)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: revise teaching ecosystem spec with brainstorm decisions

- Add 10 design decisions from deep brainstorm session
- Replace assumed config examples with real stat-545 data
- Remove shell alias references (not needed for craft)
- Add deployment/branches normalization
- Expand test cases from 6 to 8
- Add ORCHESTRATE implementation plan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: normalize flow-cli config schema for teaching ecosystem

Add _normalize_config() adapter that silently maps flow-cli's schema
(semester_info, course.name, branches) to craft-native format (dates,
course.number, deployment). Fix break validation to allow single-day
breaks (start == end). Fix broken test import and add 8 normalization
tests.

- teach_config.py: _normalize_config() with setdefault() merge pattern
- teach_config.py: break validation >= changed to > (MLK Day fix)
- test_integration_teaching_workflow.py: fix import, add TestConfigNormalization
- teaching-workflow.md: add ecosystem section with role boundaries

Spec: docs/specs/SPEC-teaching-ecosystem-coordination-2026-02-06.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update config schema and tutorial for teaching ecosystem

- teaching-config-schema.md: add flow-cli compatibility section with
  field mapping table, design principles, and example config. Document
  single-day break support. Add schema changelog v1.1 entry. Update
  validation errors table.
- teaching-mode-setup.md: add flow-cli compatibility note, single-day
  break example, link to ecosystem guide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add dedicated Teaching tab to documentation site

Add top-level Teaching navigation tab with ecosystem-aware landing
page. Teaching was previously a subsection under Guides — now it's
a first-class section with its own hub page showing the three-tool
ecosystem (flow-cli, Scholar, Craft), decision guide, config
compatibility table, and links to all teaching resources.

- docs/teaching/index.md: new landing page with grid cards, ecosystem
  overview, command reference, config compatibility summary
- mkdocs.yml: new Teaching tab (section 3), removed old Teaching Mode
  subsection from Guides, renumbered remaining sections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: sync site pages for teaching ecosystem (test counts, changelog, status)

- Update test counts 1286 → 1294 across 8 files (CLAUDE.md, README, REFCARD, etc.)
- Add [Unreleased] changelog section for teaching ecosystem coordination
- Update .STATUS with implementation complete status
- Update mkdocs.yml site description with teaching ecosystem note

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address review issues (ORCHESTRATE, spec status, normalizer)

- Remove ORCHESTRATE from tracking and add to .gitignore
- Update spec status from Draft to Implemented (craft-side)
- Use setdefault() for course dict to match dates/deployment pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Update .STATUS for teaching ecosystem merge (PR #57)
- Fix spec count 24 → 23 in CLAUDE.md (3 occurrences)
- Remove orphaned WAVE3-AGENT1-SUMMARY.md
- Remove 6 tracked brainstorm files (dir is gitignored)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix init.md test count 1174 → 1294, version v2.12.0 → v2.15.0
- Remove 49 orphaned root .md files (WAVE*, PHASE*, IMPLEMENTATION*,
  WIP*, POST-MERGE*, reports, old release notes, proposals)
- Add .gitignore patterns to prevent future accumulation
- Kept: README, CLAUDE, CONTRIBUTING, ROADMAP, AGENTS, RELEASE-v2.8.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- integration-testing.md: Teaching 8→16 tests, total 27→38, update
  expected output and test descriptions
- REFCARD-TEACHING.md: Add flow-cli config compatibility section with
  field mapping table and single-day break note
- deploy-course-website.md: Add flow-cli config compatibility tip
- teaching-migration.md: Add note for existing flow-cli users to skip
  config creation step
- check-command-mastery.md: Integration tests 27→38
- CLAUDE.md: Teaching tests 8→16, total integration 36→47
- Remove 6 orphaned docs files (gap analysis, lint baseline, session
  summaries, implementation summary)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add branch protection hooks and craft command enhancements

Implement deterministic branch protection via PreToolUse hook that
prevents destructive edits on protected branches, addressing advisory
CLAUDE.md rules failing under reasoning pressure.

Hook: ~/.claude/hooks/branch-guard.sh (~290 lines)
- main = block-all (no edits, writes, or commits)
- dev = block-new-code (new code files blocked, fixups/md/tests OK)
- feature/* = unrestricted
- Per-project config via .claude/branch-guard.json
- Auto-detect repos with dev branch
- Session-scoped bypass with reason logging

New commands: /craft:git:unprotect, /craft:git:protect
Enhanced: /craft:check, /craft:do, /craft:git:worktree, /craft:git:status

Tests: 42 unit (bash) + 6 integration (python), all passing
Performance: ~60ms/invocation (under 100ms target)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: move branch-guard hook into repo with standalone installer

The branch-guard.sh hook previously lived at ~/.claude/hooks/ outside
version control. Now scripts/branch-guard.sh is the source of truth,
and scripts/install-branch-guard.sh provides idempotent installation
for non-Homebrew users (copy + settings.json registration via jq).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add branch guard e2e and interactive test suites

- test_branch_guard_e2e.sh: 31 automated e2e tests covering full
  workflows, bypass lifecycle, config cascade, error messages,
  cross-tool consistency, dry-run, performance, and real-world scenarios
- test_branch_guard_interactive.sh: 10 human-guided QA scenarios for
  user-facing behavior (formatting, registration, commands)
- tests/cli/README.md: document both new test suites

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update .STATUS — branch protection complete (9/9 steps)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update command count 106 → 108 (added unprotect + protect)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: gitignore test CLI logs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: switch branch-guard JSON parsing to jq, address PR review

- Replace grep/sed extract_json_string with jq-based _json_get
  (Python fallback, grep/sed last resort)
- Validate config JSON before parsing; malformed config falls
  through to auto-detect with warning
- Use proper jq paths (.tool_input.file_path) instead of flat
  key search
- Remove ORCHESTRATE from tracking, add to .gitignore
- Fix "session-scoped" bypass claims — marker persists until
  re-enabled via /craft:git:protect
- Fix test configs: flat top-level keys match hook's schema
- All 79 automated tests passing (42 unit + 31 e2e + 6 integration)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address remaining PR review items

- check.md: show only current branch's guard status (not both)
- protect.md: detect actual protection level dynamically, verify
  hook is installed before reporting status
- status.md: switch grep/sed JSON parsing to jq for bypass marker
  and config file reads
- worktree.md: add belt-and-suspenders comment for main block
- tests/cli/README.md: fix test counts (42→49 unit, 7→6 integ,
  ~30→31 e2e)
- test_branch_guard.sh: add 7 edge case tests (Group 10):
  path traversal, symlinks, special branch names (slash+dot),
  git -C limitation, malformed config warning, .STATUS files,
  .R extension

Tests: 86 automated (49 unit + 31 e2e + 6 integration)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Update command count 106 → 108 across 3 files
- Update test count 1294 → 1380 across 7 files
- Add protect/unprotect to mkdocs.yml nav and git.md category page
- Add branch protection entry to CHANGELOG.md unreleased section

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- init.md template: 106→108 commands, 1294→1380 tests
- mkdocs.yml: add branch-protection spec to Specifications nav
- overview.md: add protect/unprotect to git commands list
- REFCARD.md: add protect/unprotect to git commands table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move all spec files to _archive/ since all features are released.
Update active references in commands, CLAUDE.md, mkdocs.yml nav,
and CHANGELOG. Historical references (version history, old changelogs)
left as-is for accuracy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on guide

- architecture.md: add PreToolUse hook section with protection levels
- TUTORIAL-worktree-setup.md: add branch-guard tip after safety warning
- integration-testing.md: add Category 4 (branch guard, 6 tests),
  update totals 38→44, add to key files reference table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New test file tests real craft repo (not temp repos):
- Hook installation & registration (7 tests)
- Craft repo dogfooding on dev branch (11 tests)
- Real Claude Code payload formats (10 tests)
- Extension classification coverage (16 tests)
- Error message formatting (5 tests)
- Performance benchmarks (2 tests)
- Bypass marker lifecycle (1 test)
- Dry-run mode (1 test)

Also fixed dangling symlink: hook pointed to deleted worktree,
repointed to main repo copy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump version: 2.15.0 → 2.16.0 (plugin.json, CLAUDE.md, README, REFCARD)
- Update CHANGELOG: [Unreleased] → [2.16.0] - 2026-02-07
- Fix 12 broken links from spec archival (missed _archive/ prefix)
- Add archived specs to .linkcheck-ignore (frozen docs, stale refs expected)
- Fix dead IMPLEMENTATION-SUMMARY reference in REFCARD-DOCS-UPDATE
- Add DRY-RUN-SUMMARY historical ref to .linkcheck-ignore
- All 13 core tests passing, pre-release check green

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The docs/brainstorm/ directory was empty (never had tracked files).
Removed the gitignore entry and the corresponding .linkcheck-ignore
category since there's nothing to ignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise merged commit 0032851 into main Feb 7, 2026
6 of 8 checks passed
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