CommunityProductivity & Collaborationgithub.com

workspace-workflow-builder

Use this skill to build a workspace workflow from scratch, refactor an existing one, or set up only the user-level instruction files. Triggers include phrases like "set up my project structure", "build workspace", "scaffold my project", "organize my workspace", "set up AI agent files", and others. Do NOT trigger for isolated file edits, single-file creation, pure git operations, or requests that only affect a specific tool config unrelated to project-wide structure, except setting up user-level instruction files. When intent is ambiguous, ask: "Are you looking to build a new workspace from scratch, or refactor an existing one?"

What is workspace-workflow-builder?

The Workspace Workflow Builder is a comprehensive AI Product Team skill for building or refactoring complete project workspace workflows. It follows a strict two-phase process: first, understand and define (Product Manager mode) to clarify needs, generate a URD/PRD, and confirm with the user; then, design and build (Technical Co-Founder mode) to create directory structures, file templates, workflow standards, and fully populated AI Agent workflow files. The skill generates tailored agent workflow files (CLAUDE.md, AGENTS.md, GEMINI.md, MEMORY.md, GIT_WORKFLOW.md, and companions) based on the project type and team's actual needs, embedding full behavioral discipline and a two-phase workflow. It includes critical sandbox detection and tiered permission control for safe execution across different environments, and relies on a modular documentation system with progressive disclosure for detailed guidance.

Works with✓Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/Josh-Chung/workspace-workflow-builder/tree/HEAD

Installed? Explore more Productivity & Collaboration skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Workspace Workflow Builder

An AI Product Team skill for building or refactoring complete project workspace workflows. Strictly two-phase: understand and define (Product Manager mode - clarify needs, generate URD/PRD, confirm with user), then design and build (Technical Co-Founder mode - directory structure, file templates, workflow standards, fully populated AI Agent workflow files).

Generated Agent workflow files (CLAUDE.md, AGENTS.md, GEMINI.md, MEMORY.md, GIT_WORKFLOW.md, and companions) are tailored to the project type and team's actual needs, embedding the full behavioral discipline, two-phase workflow, and - for software projects - the complete technical execution process (capability-gated sub-agent delegation, QA loops, living documentation).

CLAUDE.md / AGENTS.md / GEMINI.md / GIT_WORKFLOW.md are pure ASCII and read-only to the working agent after initialization. MEMORY.md is the agent's only self-writable file, organized as four parallel categories (Project Memory / Decision Memory / Error Memory / Operational Specification Rules).


Module layout (progressive disclosure): this SKILL.md holds the full process skeleton and all decision gates. Detailed content lives in reference files - read each one only at the phase that needs it. In the single-file edition (built by scripts/build-single-file.sh), the same content appears as appendices at the end of this document under identical titles.

WhenRead
Phase 0, only if git=missingreferences/environment-setup.md (Appendix A)
Phase 3 entry, Track Areferences/elicitation-questions.md (Appendix B)
Phase 3, after Track A resolvesreferences/elicitation-track-b.md (Appendix C)
Phase 1 when the mode is C (Home only); Phase 3 right after B0; Phase 4 and Phase 5 Step 3b, only when U1 != Areferences/user-level-files.md (Appendix U)
Phase 4, Category A generationreferences/project-file-templates.md (Appendix D)
Phase 4, Category B core + fragmentsreferences/agent-file-templates.md (Appendix E)
Phase 4, Category B entry filesreferences/entry-file-templates.md (Appendix F)
Phase 4, when MEMORY.md is generatedreferences/memory-template.md (Appendix G)
Phase 4, only when A5 = Creferences/change-logging-template.md (Appendix H)
Phase 4, Category B Phase 2 branches -- index, then one branch filereferences/phase-2-branch-templates.md (Appendix I)
Phase 4, the selected branch onlyreferences/phase-2-branch-<s/e/p/d/c/o>.md (Appendices J-O)
Phase 4, Category B git workflowreferences/git-workflow-template.md (Appendix P)
Phase 4, Team mode onlyreferences/git-workflow-team.md (Appendix Q)
Phase 4, when the project's deliverables include visual outputreferences/visual-presentation.md (Appendix R)
Phase 4, when any of that output is a press file (a PDF handed to a print shop)references/print-output.md (Appendix T) as well
Phase 5 entryreferences/execution-steps.md (Appendix S)

Phase 0 - Environment Pre-Check

⚠️ CRITICAL: Sandbox Detection & Execution Rules

Before any file operation, detect the runtime environment. Check actual runtime state indicators, not configuration files.

# Check for sandbox/CI environment indicators
echo "CI=${CI:-unset}"
echo "GITHUB_ACTIONS=${GITHUB_ACTIONS:-unset}"
echo "CODEX_SANDBOX=${CODEX_SANDBOX:-unset}"
ls /.dockerenv 2>/dev/null && echo "dockerenv=present" || echo "dockerenv=absent"
echo "HOME=$HOME"

Sandbox Classification Rules:

IndicatorConditionClassification
CI=true or GITHUB_ACTIONS=trueAny value setSandbox
CODEX_SANDBOX=trueAny value setSandbox
/.dockerenv existsFile presentSandbox
HOME=/home/sandboxExact path matchSandbox
HOME=/rootLinux root user⚠️ NOT a sandbox - do not false-positive
None of the above-Local / Non-sandbox

Tiered Permission Control (Risk-Stratified)

All file operations in this skill are governed by the following risk tiers, applied dynamically regardless of mode:

Risk LevelOperation TypesIn SandboxNon-Sandbox
🟢 LowCreate new directories, write new files (no prior content)Auto-executeAuto-execute
🟡 MediumModify existing files, rename directoriesInteractive: diff → confirm. Non-interactive (CI): do NOT write - emit a patch file + apply instructionsDisplay diff → require confirmation
🔴 HighDelete files/directories, overwrite existing filesHard stop → provide user instructionsForced step-by-step confirmation per item
🟠 HomeWrite a user-level instruction file chosen in U1 (e.g. ~/.claude/CLAUDE.md, ~/.gemini/GEMINI.md) - outside the workspace, loaded in every projectNever write: emit user-level-personal-defaults.proposed.md + next-step instructionsFull diff → per-file confirmation, even for a new file
🚫 ProhibitedExternal network requests, OAuth flows, cross-repo operations, any write outside the workspace except the U1 user-level instruction files (🟠 Home)Permanently prohibitedN/A

Non-interactive rule: A sandbox/CI run has no human available to confirm. Any tier that requires confirmation must degrade to a no-write artifact (patch file or instruction block) instead of waiting on input that will never arrive.

Dead-End Prevention Principle: Every prohibited or hard-stopped action must be accompanied by clear, actionable user-facing instructions. Never leave the user without a next step.

Tool Availability Check

Run the following detection block first:

# Detect OS and package manager
OS="unknown"
PKG_MANAGER="unknown"
uname -s | grep -qi "darwin"  && OS="macos"
uname -s | grep -qi "linux"   && OS="linux"
uname -s | grep -qi "mingw\|cygwin\|msys" && OS="windows"

command -v brew    &>/dev/null && PKG_MANAGER="brew"
command -v apt-get &>/dev/null && PKG_MANAGER="apt"
command -v dnf     &>/dev/null && PKG_MANAGER="dnf"
command -v yum     &>/dev/null && PKG_MANAGER="yum"
command -v pacman  &>/dev/null && PKG_MANAGER="pacman"
command -v winget  &>/dev/null && PKG_MANAGER="winget"
command -v choco   &>/dev/null && PKG_MANAGER="choco"

echo "OS=$OS | PKG_MANAGER=$PKG_MANAGER"

# Check each tool
git  --version 2>/dev/null && echo "git=ok"  || echo "git=missing"
tree --version 2>/dev/null && echo "tree=ok" || echo "tree=missing"
gh   --version 2>/dev/null && echo "gh=ok"   || echo "gh=missing"
jq   --version 2>/dev/null && echo "jq=ok"   || echo "jq=missing"

Tool Classification & Response Strategy

ToolRequired?If Missing
git⚙️ ConditionalRequired when deliverables include git workflow content (GIT_WORKFLOW.md, branch strategy, CODEOWNERS, commit-hash changelog) or Mode B migration of a git repo: read references/environment-setup.md and run its decision tree (confirm-first install → manual guide → sandbox hard stop). Optional for documentation-type projects (A1 = D or E) or when the user declines git: skip git-dependent deliverables and note the omission in the plan document - never hard-stop a deliverable that does not need git.
treeOptionalSilent fallback to find - no user action needed
ghOptionalSkip branch protection checks; note omission in plan document
jqOptionalUse plain text parsing; no user action needed

Optional-tool fallback details: see the table at the end of references/environment-setup.md.


Phase 1 - Mode Detection

Determine which operating mode applies:

┌─────────────────────────────────────────────────────────┐
│  Does the project already have an existing workspace     │
│  structure the user wants to work with?                  │
├─────────────────────────────────────────────────────────┤
│  NO  → Mode A: Bootstrap (build from scratch)           │
│  YES → Mode B: Refactor (analyze and restructure)       │
│  Only the home-folder files → Mode C: Home only         │
└─────────────────────────────────────────────────────────┘

If unclear from the user's message, ask exactly one question:

"Are you building a new workspace from scratch, refactoring an existing one, or only setting up your user-level instruction files?"

Mode C writes only the user-level instruction files (personal defaults in the home folder) and builds no workspace. Read references/user-level-files.md now and follow its Mode C route, which replaces Phases 2-6 below.


Phase 2 - Existing Structure Capture (Mode B Only)

Skip this phase entirely for Mode A.

Capture the existing workspace structure using the highest-priority available method:

Method 1 - Active Scan (Preferred, run if environment permits)

# Attempt tree first; fall back to find if unavailable
if command -v tree >/dev/null 2>&1; then
  tree -L 4 -a --noreport -I '.git|node_modules|__pycache__|.DS_Store|*.pyc'
else
  find . -not -path '*/.git/*' \
         -not -path '*/node_modules/*' \
         -not -path '*/__pycache__/*' \
         -not -name '.DS_Store' \
  | sort | sed -e 's|[^/]*/|  |g'
fi

Method 2 - User Upload

If active scan is not possible (no filesystem access), ask:

"Please upload your directory structure - accepted formats: tree command output text, a screenshot, or any exported structure file."

Method 3 - User Description (Fallback)

If neither scan nor upload is possible:

"Please describe your existing workspace structure in text - include main directory names and their purposes."

Once structure is captured, proceed to Phase 3.


Phase 3 - Requirements Elicitation (Dual-Track)

This is the core information-gathering gate. The full bilingual question bank (A1-A6, B0-B10) lives in references/elicitation-questions.md - read it on entering this phase. The add-on questions U1-U2 (user-level instruction files in the home folder) live in references/user-level-files.md; ask U1 right after B0, whatever B0 chose.

Gate Rules

  • Ask only ONE question per turn. Questions must include concrete options (A/B/C/D). Challenge flawed or contradictory inputs before accepting them.
  • Completion gate (testable): Phase 4 may begin only when every question in the active set has exactly one of: (a) a user answer, (b) a preset default, or (c) a pruning-matrix resolution. The active set is the full bank minus preset-covered and pruned questions. Do not display confidence percentages - completion is binary and auditable.
  • Escape hatch: the user may say "generate now" at any time. Fill every unanswered question with the active preset's defaults (Solo-Lite if no preset was chosen), and mark every defaulted item with * in the confirmation summary.

P0. Preset Profile Selection (always the first question)

Pick a starting profile, or customize item by item?

A profile pre-fills sensible defaults for most questions, leaving only a few that must be asked. Every default is listed in the confirmation summary and can be overridden before Phase 4.

A) Solo-Lite - Solo project, minimal process. Remaining questions: A1 (project type/tech stack), B0 (Agent selection), B1 (only if Claude selected). B) Team-Standard - 2-20 person team, structured collaboration. Remaining: A1, B0, B1 if applicable, B4 if multi-agent, B5, B10 follow-up (existing guarantees). C) Enterprise-Full - 20+ people, full governance. Remaining: same as B, plus A3 platform confirmation. D) Custom - Full question bank (the pruning matrix still applies).

Preset default table (every cell can be overridden at the summary):

QuestionSolo-LiteTeam-StandardEnterprise-Full
A2 Team scaleA (solo)B/C (per stated size)D (20+)
A3 CI/CDA (none)B (GitHub Actions)ask (platform confirmation)
A4 Branch strategyA (GitHub Flow)A (GitHub Flow)B (Git Flow)
A5 ChangelogA (none)B (manual)C (agent-maintained)
A6 Agent file trackingA (exclude)C (track GIT_WORKFLOW.md only)C (track GIT_WORKFLOW.md only)
B2 Memory strategyC (hybrid)C (hybrid)B (persistent)
B3 Memory categoriesA (basic 4: three memories + operational rules)B (A + shared)C (A + shared + private)
B4 Division of work (multi-agent only)A (one lead writes); lead follow-up still askedaskask
B5 Agent-Git ownershipB (one agent drafts)askask
B6 GIT_WORKFLOW scopeA (basic)B (merge + PR standards)D (full governance)
B7 Failure strategyB (pause + ask)B (pause + ask)C (human-directed fallback)
B8 AuditB (lightweight)C (structured)D (full audit trail)
B9 Memory cleanupA (event-driven standard)C (event-driven + iteration review)C (event-driven + iteration review)
B10 Rule enforcementA (all prose-level)B (mark absolutes); follow-up still askedC (B + wiring checklist); follow-up still asked
U1 User-level instruction filesA (none)A (none)A (none)

Conditional Pruning Matrix

Apply on top of any preset, and in Custom mode. A pruned question is resolved, not skipped silently - its resolution appears in the confirmation summary.

ConditionPrunedResolution
A1 = APHASE 2 branchgenerate Branch S (Engineering); [A1 = A ONLY] blocks included
A1 = B/CPHASE 2 branchgenerate Branch E (Data & Expe

Related Skills