Unified entry point for ALL GitHub pushes โ both Local (project repo) and Global (craft-framework-master-dev)
Derives target repos dynamically from PROJECT_ID and MONOREPO_ROLE. Never hardcodes repo names. For Global pushes, delegates to CWK-045. For Local pushes, manages repo discovery, remote validation, archive detection, auto-fix of wrong remotes (with human confirmation), and PAT-based push. Supersedes CWK-038 for two-repo model pushes.
Push Orchestrator
TL;DR
How To Start
STEP 1Provide Push Details
-
push_type
· string · required · options: local | global
Which repo to push to. “local” pushes to CFT-PROJ-CP-{NNN} derived from PROJECT_ID. “global” delegates to CWK-045 for craft-framework-master-dev (MASTER only). -
pat
· string · required
GitHub Personal Access Token. Provided by human per session. Used in push URL, scrubbed after. -
global_files
· list · optional
Files to push to Global repo. Required when push_type=“global”. Passed through to CWK-045. -
commit_message
· string · optional
Commit message for Global push. Required when push_type=“global”. Passed through to CWK-045. -
repo_name_override
· string · optional · default: None
Override the derived Local repo name. Use only when the GitHub repo doesn’t match PROJECT_ID convention. Ignored for global pushes. -
github_org
· string · optional · default: from PROJECT_GITHUB_ORG or “CRAFTFramework”
GitHub organization. Rarely overridden. -
dry_run
· boolean · optional · default: false
Validate everything but don’t push. Shows what would happen. -
skip_archive_check
· boolean · optional · default: false
Skip the GitHub API archive status check. Use only if gh CLI is unavailable in sandbox.
Usage Examples
EXAMPLE 1Standard local push
EXAMPLE 2Global push delegation
EXAMPLE 3Remote mismatch auto-fix
How AI Reads This Recipe
- Read project config. Extract PROJECT_ID, MONOREPO_ROLE, and PROJECT_GITHUB_ORG from the project implementation file. Derive local_repo_name from PROJECT_ID and construct repo URLs. If PROJECT_ID is not found, report error and stop.
- Route by push type. If push_type=“global”: verify MONOREPO_ROLE=MASTER (non-MASTER stops with CWK-039 redirect), verify global_files and commit_message provided, delegate to CWK-045. CWK-045 owns the rest of the global flow. If push_type=“local”: continue.
- Resolve local repo. Apply repo_name_override if provided, otherwise use derived name. Construct full repo URL. Ask human to confirm the push target — wait for confirmation.
- Validate remote. Check origin remote exists (add if missing with confirmation). Compare origin URL to derived URL (auto-fix mismatch with confirmation). Check repo accessibility — try gh CLI for archive status, fall back to git ls-remote. Stop on archived or not-found repos.
- Pre-push safety. Verify on main branch. Verify clean working tree (recommend CWK-005 if dirty). Fetch and report behind/ahead counts. Log commits to push.
- Execute push. If dry_run, report what would happen and stop. Otherwise push via PAT URL. Handle rejection (pull first), auth failure (new PAT), archive error, and unexpected errors.
- Report. Push target (derived, not hardcoded), branch, method, commit range, and any remote fixes applied. Update handoff with push details.
When To Use This Recipe
Recipe FAQ
Why not just use git push directly?
How does repo derivation work?
What’s the relationship between CWK-046 and CWK-045?
What happens if the remote doesn’t match?
Does this work for any CRAFT project?
Version History
Get this recipe with CRAFT for Claude Cowork
Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.
Pull anytime to stay on the latest version — free to clone, no login or email required.
Then start your session
Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:
You
Claude
Not familiar with Git? Download as a ZIP
No command line needed. Just download, move, and unzip:
- Open the CRAFT framework repo on GitHub.
- Click the green Code button, then choose Download ZIP.
- Move the downloaded ZIP into your Claude Cowork project folder.
- Unzip it: double-click on Mac, or right-click → Extract All on Windows.
