Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .STATUS
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ release_date: 2026-02-06
milestone: v2.16.0 - Teaching Ecosystem + Branch Protection
last_session: 2026-02-07

progress: Teaching ecosystem merged, branch protection pending
progress: Teaching ecosystem merged, branch protection complete, ready for PR

📊 Branch Status:

| Branch | Head | Base | Status |
|--------|---------|------|---------------------------------|
| main | bbd6ac7 | — | Production (v2.15.0 released) |
| dev | 0f94d9d | main | Teaching ecosystem merged (PR #57) |
| feature/branch-protection | 2087a98 | dev | ORCHESTRATE ready |
| feature/branch-protection | — | dev | Implementation complete, PR ready |

✅ v2.15.0 — Brainstorm v2.5.0: Spec Simplification + Smart Questions (2026-02-06):
- Brainstorm spec simplification: 1,919 → 312 lines (84% reduction)
Expand All @@ -38,16 +38,16 @@ progress: Teaching ecosystem merged, branch protection pending
**feature/teaching-ecosystem**: ✅ MERGED (PR #57, 2026-02-07)
- Config normalizer, break validation fix, 8 new tests, Teaching docs tab

**feature/branch-protection** (9 steps):
1. Hook script (~/.claude/hooks/branch-guard.sh)
2. Hook config (settings.json PreToolUse registration)
3. Dry-run test
4. Enable enforcement
5. Per-project config (.claude/branch-guard.json)
6. Craft command enhancements (check, do, worktree, status)
7. New commands (unprotect, protect)
8. Tests (17 hook + 4 integration)
9. Documentation
**feature/branch-protection** (9/9 complete ✅):
1. Hook script (scripts/branch-guard.sh — moved into repo)
2. Hook config (settings.json PreToolUse registration)
3. Dry-run test
4. Enable enforcement
5. Per-project config (.claude/branch-guard.json)
6. Craft command enhancements (check, do, worktree, status)
7. New commands (unprotect, protect)
8. Tests (49 unit + 31 e2e + 6 integration = 86 total)
9. Documentation + standalone installer + Homebrew formula

## Future (v2.17.0+)

Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "craft",
"version": "2.15.0",
"description": "Full-stack developer toolkit with integrated workflow automation - 106 commands (94 craft + 12 workflow), 8 agents, 21 skills with standardized dry-run preview mode (29 with --dry-run support). Code, git, site, docs, testing, architecture, CI, distribution, teaching workflows, planning, and ADHD-friendly features including brainstorming, task management, and spec capture",
"description": "Full-stack developer toolkit with integrated workflow automation - 108 commands (96 craft + 12 workflow), 8 agents, 21 skills with standardized dry-run preview mode (29 with --dry-run support). Code, git, site, docs, testing, architecture, CI, distribution, teaching workflows, planning, and ADHD-friendly features including brainstorming, task management, and spec capture",
"author": {
"name": "Data-Wise",
"email": "dt@stat-wise.com"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ env/
.DS_Store
Thumbs.db

# Test reports
# Test reports and logs
tests/craft_test_report.md
tests/cli/logs/
.coverage

# Brainstorm documents (working drafts)
Expand Down
66 changes: 34 additions & 32 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

> **TL;DR**: Use `/craft:do <task>` for smart routing, `/craft:check` before commits, `/craft:git:worktree` for feature branches. **Always start work from `dev` branch** - never commit to `main` directly.

**106 commands** · **21 skills** · **8 agents** · **23 specs** · [Documentation](https://data-wise.github.io/craft/) · [GitHub](https://github.com/Data-Wise/craft)
**108 commands** · **21 skills** · **8 agents** · **23 specs** · [Documentation](https://data-wise.github.io/craft/) · [GitHub](https://github.com/Data-Wise/craft)

**Current Version:** v2.15.0 | **Latest Release:** v2.15.0 (2026-02-06)
**Documentation Status:** 99% complete | **Tests:** 1294 passing (176 claude-md + 998 core + 74 formatting + 38 brainstorm-context + 8 teaching-normalization)
**Documentation Status:** 99% complete | **Tests:** 1380 passing (176 claude-md + 998 core + 74 formatting + 38 brainstorm-context + 8 teaching-normalization + 86 branch-guard)

## Git Workflow

Expand Down Expand Up @@ -34,6 +34,17 @@ feature/* (worktrees) ← All implementation work
- **Never** write feature code on `dev`
- **Always** verify branch: `git branch --show-current`

### Branch Protection (Enforced by Hook)

| Branch | Code Files | .md Files | Git Operations |
|--------|-----------|-----------|----------------|
| `main` | BLOCKED | BLOCKED | Commit/push BLOCKED |
| `dev` | New: BLOCKED, Existing: allowed | ALLOWED | Commit/push allowed |
| `feature/*` | ALLOWED | ALLOWED | All allowed |

Override: `/craft:git:unprotect` (session-scoped, auto-expires)
Config: `.claude/branch-guard.json` (per-project, optional)

## Quick Commands

| Task | Shell | Craft |
Expand Down Expand Up @@ -91,7 +102,7 @@ Auto-selection: debug (errors), optimize (performance), release (deploy), else d
```text
craft/
├── .claude-plugin/ # Plugin manifest, hooks, validators
├── commands/ # 106 commands (arch, ci, code, docs, git, site, test, workflow)
├── commands/ # 108 commands (arch, ci, code, docs, git, site, test, workflow)
├── skills/ # 21 specialized skills
├── agents/ # 8 agents
├── scripts/ # 30+ utility scripts (dependency management, converters, installers)
Expand All @@ -107,43 +118,25 @@ craft/

## Recent Major Features

### v2.15.0 - Brainstorm v2.5.0: Spec Simplification + Smart Questions (2026-02-06) ✅
### v2.16.0 - Branch Protection Hooks (2026-02-06) ✅

**Part 1: Spec Simplification** — brainstorm.md reduced from 1,919 → 312 lines (84% reduction). Extracted to:
**New Hook:** `~/.claude/hooks/branch-guard.sh` (~290 lines) — PreToolUse hook enforcing branch protection (main=block-all, dev=block-new-code, feature=unrestricted). Per-project config via `.claude/branch-guard.json`.

- `docs/specs/SPEC-brainstorm-question-bank.md` — Full question bank + project-type extensions
- `docs/tutorials/TUTORIAL-brainstorm-power-user.md` — Detailed examples + advanced patterns
- `docs/reference/REFCARD-BRAINSTORM.md` — Flowcharts + quick reference card
**New Commands:** `/craft:git:unprotect` + `/craft:git:protect` (session-scoped bypass)
**Enhanced:** `/craft:check` (branch context), `/craft:do` (branch-aware routing), `/craft:git:worktree` (main block), `/craft:git:status` (guard indicator)
**Tests:** 42 unit + 6 integration, all passing. **Files Changed:** 12 (+2,200 lines)

**Part 2: Context-Aware Smart Questions** — New Step 1.7 context scan before presenting questions:

- `utils/brainstorm_context.py` (~280 lines) — Scans .STATUS, specs, git log, CLAUDE.md
- Project-type question extensions: 12 new questions (2 per type: R, Python, Node, Quarto, Plugin, Teaching)
- Dynamic questions: matching specs, prior brainstorms, failing tests
- Pre-fills answers from project state (version, current task)
---

**Tests:** 38 new tests (test_brainstorm_context.py), all passing
### v2.15.0 - Brainstorm v2.5.0: Spec Simplification + Smart Questions (2026-02-06) ✅

**Files Changed:** 8 (+1,500/-1,600)
Brainstorm.md reduced 1,919 → 312 lines (84% reduction). New `utils/brainstorm_context.py` (~280 lines) scans .STATUS, specs, git log for context-aware smart questions. 12 project-type extensions, dynamic questions from project state. **Tests:** 38 new. **Files Changed:** 8 (+1,500/-1,600)

---

### v2.14.0 - Unified Formatting Library (2026-02-05) ✅

**Branch:** `feature/styled-output`

**New Library:** `scripts/formatting.sh` (~180 lines) — shared bash formatting library providing box-drawing (double/single line), `FMT_` prefixed color constants, ANSI-aware padding, table formatting, and source guard. All boxes standardized to 63 visible characters.

**API:** `box_header`, `box_single`, `box_row`, `box_separator`, `box_footer`, `box_empty_row`, `box_table`, `fmt_set_width`, `fmt_divider`, `_fmt_strip_ansi`.

**Migrations:**

- 8 box-drawing scripts migrated (install.sh, migrate-from-workflow.sh, convert-cast.sh, health-check.sh, consent-prompt.sh, dependency-installer.sh, dependency-manager.sh)
- 15 color-only scripts migrated (validate-counts, pre-release-check, batch-convert, repair-tools, 3 installers, tool-detector, version-check, sync-version, verify-phase1/2, install-hooks, test-fix-flag, pre-commit-markdownlint)

**Tests:** 74 new tests (28 unit + 30 integration + 16 edge cases)

**Files Changed:** 24 (+1,100/-300)
`scripts/formatting.sh` (~180 lines) — shared box-drawing, `FMT_` color constants, ANSI-aware padding. 23 scripts migrated (8 box-drawing + 15 color-only). All boxes standardized to 63 visible characters. **Tests:** 74 new. **Files Changed:** 24 (+1,100/-300)

---

Expand Down Expand Up @@ -527,6 +520,12 @@ See `docs/specs/` for detailed specifications (23 total). See `docs/VERSION-HIST
| `scripts/pre-release-check.sh` | Pre-release validation (version, counts, clean tree) |
| `scripts/docs-lint-emoji.sh` | Standalone CRAFT-001 check for pre-commit hook |
| `.prettierignore` | Prevents prettier from breaking emoji-attribute spacing |
| `.claude/branch-guard.json` | Per-project branch protection config (optional) |
| `commands/git/unprotect.md` | Session-scoped bypass for branch protection |
| `commands/git/protect.md` | Re-enable branch protection |
| `tests/test_branch_guard.sh` | Branch guard hook unit tests (49 tests) |
| `tests/test_branch_guard_e2e.sh` | Branch guard e2e tests (31 tests) |
| `tests/test_integration_branch_guard.py` | Branch guard integration tests (6 tests) |

## Test Suite

Expand All @@ -543,17 +542,20 @@ See `docs/specs/` for detailed specifications (23 total). See `docs/VERSION-HIST
| `tests/test_claude_md_v3.py` | 51 | 100% | v3 sync/optimizer (v2.12.0) |
| `tests/test_claude_md_audit.py` | 11 | 100% | Audit module (v2.10.0) |
| `tests/test_brainstorm_context.py` | 38 | 100% | Context scanner (v2.15.0) |
| `tests/test_branch_guard.sh` | 49 | 100% | Branch guard hook (v2.16.0) |
| **Integration & E2E Tests** | | | |
| `tests/test_command_enhancements_e2e.py` | 93 | 100% | Command enhancements (v2.9.0)|
| `tests/test_integration_brainstorm_phase1.py` | 24 | 100% | Question control integration |
| `tests/test_integration_dependency_system.py` | 9 | 100% | Dependency workflow |
| `tests/test_integration_orchestrator_workflows.py` | 13 | 100% | Task routing & scoring |
| `tests/test_integration_claude_md_v3.py` | 9 | 100% | v3 sync/optimizer integ. |
| `tests/test_integration_teaching_workflow.py` | 16 | 100% | Teaching mode + normalization (2 skipped) |
| `tests/test_integration_branch_guard.py` | 6 | 100% | Branch guard integration |
| `tests/test_branch_guard_e2e.sh` | 31 | 100% | Branch guard e2e (v2.16.0) |
| **System Tests** | | | |
| `tests/test_dependency_management.sh` | 79 | 100% | Dependency system |
| `tests/test_formatting.sh` | 74 | 100% | Formatting library (v2.14.0) |
| **Total** | **1294** | **~90%** | **All systems** |
| **Total** | **1380** | **~90%** | **All systems** |

## Troubleshooting

Expand All @@ -575,7 +577,7 @@ See `docs/specs/` for detailed specifications (23 total). See `docs/VERSION-HIST
## Links

- [Documentation Site](https://data-wise.github.io/craft/) — Full guides and references
- [Commands Reference](https://data-wise.github.io/craft/commands/) — All 106 commands
- [Commands Reference](https://data-wise.github.io/craft/commands/) — All 108 commands
- [Architecture Guide](https://data-wise.github.io/craft/architecture/) — How Craft works
- [Specifications](docs/specs/) — Implementation specs (23 total)
- [Version History](docs/VERSION-HISTORY.md) — Complete release timeline (NEW)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Documentation](https://img.shields.io/badge/docs-99%25%20complete-brightgreen.svg)](https://data-wise.github.io/craft/)

> **v2.15.0 - Brainstorm v2.5.0: Spec Simplification + Smart Questions** 🚀
> **106 commands** | **21 skills** | **8 agents** | **1294 tests passing**
> **108 commands** | **21 skills** | **8 agents** | **1380 tests passing**
> Brainstorm spec reduced 84% (1,919 → 312 lines) with context-aware smart questions.

A comprehensive production-ready toolkit for Claude Code featuring smart orchestration, ADHD-friendly workflows, multi-agent coordination, and complete documentation coverage.
Expand Down Expand Up @@ -135,7 +135,7 @@ Craft is a pure plugin that uses built-in Claude Code capabilities. No external
- [Quick Start](https://data-wise.github.io/craft/QUICK-START/) (30 seconds)
- [ADHD Guide](https://data-wise.github.io/craft/ADHD-QUICK-START/) (neurodivergent-friendly)
- [Visual Workflows](https://data-wise.github.io/craft/workflows/) (10 GIF demonstrations)
- [Command Reference](https://data-wise.github.io/craft/REFCARD/) (all 106 commands)
- [Command Reference](https://data-wise.github.io/craft/REFCARD/) (all 108 commands)
- [Skills & Agents](https://data-wise.github.io/craft/guide/skills-agents/) (21 skills, 8 agents)
- [Claude Code 2.1 Integration](https://data-wise.github.io/craft/guide/claude-code-2.1-integration/) (comprehensive guide with 9 diagrams)
- [Complexity Scoring Algorithm](https://data-wise.github.io/craft/guide/complexity-scoring-algorithm/) (complete technical documentation with 8 diagrams)
Expand Down
3 changes: 3 additions & 0 deletions commands/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Preview which checks will be performed without actually executing them:
│ - Build tool: uv │
│ - Config: pyproject.toml │
│ - Worktree: No (main repo) │
│ - Guard: Active (block-new-code) │
│ - Git status: Clean working tree │
│ │
│ ✓ Validation Plan (5 checks): │
Expand Down Expand Up @@ -149,6 +150,7 @@ Pre-flight Check Plan:
Project: <project-name> (<project-type>)
Mode: <mode>
Branch: <current-branch>
Guard: <protection-status>
Context: <for-value or "general">

Checks to run:
Expand Down Expand Up @@ -286,6 +288,7 @@ fi
│ 🌳 Worktree: ~/.git-worktrees/scribe/feat-hud │
│ Main: ~/projects/dev-tools/scribe │
│ Branch: feat/mission-control-hud │
│ Guard: None (feature branches unrestricted) │
├─────────────────────────────────────────────────────┤
│ ✓ Lint 0 issues │
│ ... │
Expand Down
54 changes: 50 additions & 4 deletions commands/do.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,58 @@ Preview which commands will be executed without actually running them:

**Note**: Dry-run shows routing decision based on complexity score. Agent delegation triggers for medium (4-7) and complex (8-10) tasks.

## Branch-Aware Routing (NEW in v2.16.0)

Before routing, check branch protection status. When on `dev` or `main` and the task involves code changes:

### On `dev` (block-new-code)

If task involves creating new files or writing code:

```json
{
"questions": [{
"question": "You're on dev (protected). How should I handle this code task?",
"header": "Branch",
"multiSelect": false,
"options": [
{
"label": "Create worktree (Recommended)",
"description": "Auto-create feature branch and worktree from task description."
},
{
"label": "Write spec only",
"description": "Create a spec file on dev (allowed) without code changes."
},
{
"label": "Analyze only",
"description": "Read and analyze code without making edits."
}
]
}]
}
```

### On `main` (block-all)

```
Cannot route code tasks on main. All changes go through PRs.

Switch to dev: git checkout dev
Then retry: /craft:do <task>
```

### On `feature/*`

Route directly without branch intervention — no restrictions.

## How It Works

1. **Check Spec** - Look for existing spec matching task (NEW in v1.1.0)
2. **Analyze** - Parse task description for intent and category
3. **Score Complexity** - Calculate 0-10 score based on 5 factors (NEW in v1.23.0)
4. **Route Decision** - Choose execution strategy:
1. **Check Branch** - Verify branch protection status (NEW in v2.16.0)
2. **Check Spec** - Look for existing spec matching task (NEW in v1.1.0)
3. **Analyze** - Parse task description for intent and category
4. **Score Complexity** - Calculate 0-10 score based on 5 factors (NEW in v1.23.0)
5. **Route Decision** - Choose execution strategy:
- **Score 0-3**: Route to craft commands (traditional)
- **Score 4-7**: Delegate to specialized agent (NEW)
- **Score 8-10**: Delegate to orchestrator-v2 (NEW)
Expand Down
6 changes: 3 additions & 3 deletions commands/docs/claude-md/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Analyzing project structure...

Detected indicators:
✓ .claude-plugin/plugin.json exists
✓ commands/ directory (106 commands)
✓ commands/ directory (108 commands)
✓ skills/ directory (21 skills)
✓ agents/ directory (8 agents)

Expand Down Expand Up @@ -114,8 +114,8 @@ Generated CLAUDE.md Preview

> **TL;DR**: Development workflow orchestration plugin

**106 commands** · **21 skills** · **8 agents**
**Version:** v2.15.0 | **Tests:** 1294 passing
**108 commands** · **21 skills** · **8 agents**
**Version:** v2.15.0 | **Tests:** 1380 passing

## Git Workflow
[...]
Expand Down
Loading
Loading