Cfn work mode

From masharratt/claude-flow-novice · View interactive version

Cfn work mode is an AI agent skill from the GitHub repository masharratt/claude-flow-novice. Global no-visible-windows flag for when the user is at work and the Mac screen may be seen. While on, a Bash guard refuses anything that opens a window (open, osascript, GUI app binaries, game/player builds, headed browsers, Unity without -nographics, Blender without -b) and queues the refused comma

How to use this skill

Skill file

Work Mode

Contract

The user is at work and the Mac's screen may be seen by others. While the flag is on:

no launching GUI apps or game/player binaries (*.app/Contents/MacOS/*, MDTWII Builds/*.app),

no headed browsers (playwright --headed/--ui/--debug).

(EditMode tests: tools/unity/run.sh --nographics --test EditMode). Captures, player builds and render

jobs (CaenBuild.BuildCapture*, CampaignCapture, CampaignPlayerBuild) are refused even with --nographics.

queue; work-mode.sh off and work-mode.sh queue print it for the user to run later. Do not retry a refused

command or look for another way to show a window. Note the pending visual check in your report and carry on.

the guard does not enforce it.

on anything that does not depend on the answer.

Swapping with night mode

The two modes are exclusive.

CLI reference

bash $HOME/.claude/skills/cfn-work-mode/work-mode.sh on               # night off first, then flag on
bash $HOME/.claude/skills/cfn-work-mode/work-mode.sh off              # flag off, print the queue
bash $HOME/.claude/skills/cfn-work-mode/work-mode.sh status           # both flags, queue size, registrations
bash $HOME/.claude/skills/cfn-work-mode/work-mode.sh queue [--clear]  # list (or empty) refused commands
bash $HOME/.claude/skills/cfn-work-mode/work-mode.sh doctor [--install]
bash $HOME/.claude/skills/cfn-work-mode/mode.sh night|work|off|status

State lives in $HOME/.claude/: .work-mode-active (ISO UTC start, the flag; it does not expire) and

.work-mode-queue.log (<iso>\t<project>\t<cwd>\t<command>). Overrides: CFN_WORK_MODE_DIR,

CFN_WORK_SETTINGS, CFN_WORK_MODE_PATTERNS, and CFN_NIGHT_MODE_DIR for the night flag.

Rules are data

patterns.conf in this folder holds every block/allow rule: action ;; scope ;; regex ;; message, first

match wins per simple command. Scope * applies everywhere; a project name (the folder holding the repo's

.git, so worktrees count as their main repo) applies only there. MDTWII's rules live there too. Add a

rule, then add a case to the test script and run it.

The guard splits the Bash command into simple commands on ; & | ( ) backticks and newlines outside quotes,

strips leading VAR=value and wrappers (env, nohup, exec, time, timeout N), and matches rules

anchored on the program being run. So fopen, --open-files, git log --oneline, quoted text and

grep ... tools/unity/run.sh all pass. Known gap: a command hidden inside a quoted string

(bash -c "open x") is not inspected.

Hooks

refused, the allowed alternative, and that it was queued. Fails open (exit 0) when the flag is off, jq is

missing, or patterns.conf is missing.

Registrations live in ~/.claude/settings.local.json. Install or repair with doctor --install; verify with

plain doctor (exit 1 names what is missing).

Dependencies

bash, jq, git (project detection), awk.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.