Skip to content

feat: work -e editor flag#396

Merged
Data-Wise merged 8 commits intodevfrom
feature/work-editor-flag
Feb 16, 2026
Merged

feat: work -e editor flag#396
Data-Wise merged 8 commits intodevfrom
feature/work-editor-flag

Conversation

@Data-Wise
Copy link
Owner

@Data-Wise Data-Wise commented Feb 16, 2026

Summary

  • Replace auto-editor behavior with explicit -e [EDITOR] flag on work command
  • Fix arg parser so -e works in any position (work flow -e, work -e flow, work -e code flow)
  • Add Claude Code editor modes: cc, ccy (yolo), cc:new (new Ghostty window)
  • Deprecation shim for old work <proj> <editor> positional syntax (warns but still works)

Changes

Code

  • commands/work.zsh — Full arg parser rewrite (while-loop → positional scan with remaining array)

Tests

  • tests/test-work.zsh — 31 → 70 tests with mock project env covering:
    • Editor flag in all positions (-e, --editor, bare, with value, before/after project)
    • _flow_open_editor edge cases (empty, unknown, all editor branches)
    • .STATUS parsing (Status, Phase, missing file)
    • finish/hop help flags and error handling
    • Arg parser edge cases (no $EDITOR fallback, unknown flags, extra positional args)
    • Teaching workflow detection, first-run welcome, token validation helpers

Documentation

  • docs/commands/work.md — Complete rewrite for -e flag, 9 editor options documented
  • docs/help/QUICK-REFERENCE.md — Updated work examples with -e flag
  • docs/CHANGELOG.md — v7.2.0 entry
  • docs/commands/hop.md — Updated -e flag references
  • docs/tutorials/01-first-session.md — Fixed stale "work opens editor" claims, now teaches -e flag
  • CLAUDE.md — Quick Reference updated, date stamps

Test plan

  • ./tests/run-all.sh — 45/45 suites passing
  • ./tests/test-work.zsh — 70/70 tests passing
  • work flow -e / work -e flow / work -e code flow all work
  • work flow nvim shows deprecation warning
  • Manual: work <project> -e code opens VS Code
  • Manual: work <project> -e cc launches Claude Code

🤖 Generated with Claude Code

Test User and others added 8 commits February 16, 2026 11:19
work <project> now just cd's and shows context by default. Use -e to
explicitly request an editor. Adds cc/claude/ccy for Claude Code
integration, including Ghostty new-window support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rewrite docs/commands/work.md: new synopsis, -e flag, Claude Code
  editors (cc/ccy/cc:new), deprecation notice, bumped to v7.2.0
- Update QUICK-REFERENCE.md: work command examples with -e flag
- Update CHANGELOG.md: add [7.2.0] entry for editor flag feature
- Update hop.md: reference work -e flag in related commands
- Update CLAUDE.md: add work -e to quick reference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The while-loop flag parser only handled flags before the project arg.
`work flow -e` silently failed (treated -e as deprecated positional
editor). Replaced with full arg scan that collects flags from any
position, so both `work -e flow` and `work flow -e` work correctly.

Tests: 39 passing (was 31), 8 new tests with mock project env that
exercises the full code path through _flow_open_editor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tutorial incorrectly stated "work . opens the appropriate editor".
Now correctly teaches that work starts a session, and -e is optional
for opening an editor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New test categories:
- _flow_open_editor edge cases (empty, unknown, branch checks)
- .STATUS parsing (Status, Phase, missing file)
- finish/hop help flags (--help, -h, help shorthand)
- hop invalid project error handling
- work help output content validation
- arg parser edge cases (bare -e, no $EDITOR, unknown flags)
- teaching workflow detection (_work_teaching_session)
- first-run welcome (marker creation, skip on second call)
- token validation helpers (function existence, non-git dir)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise merged commit 1598e7f into dev Feb 16, 2026
1 check passed
Data-Wise pushed a commit that referenced this pull request Feb 16, 2026
…framework

Resolves merge conflicts from work -e editor flag (PR #396) added on dev
after the testing overhaul branched. Converts 40+ new editor/help/arg-parser
tests from inline framework to shared test-framework.zsh assertions.

71/71 test-work.zsh passing, dogfood 4/4 clean, full suite 45/45.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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