submodule-setup
This skill should be used when the user asks to "set up submodules", "migrate branches to submodules", "automate submodule sync", "create submodule architecture", "convert branches to repos", or mentions setting up git submodules with GitHub Actions automation for multi-repo synchronization.
What this skill does
# Submodule Setup
<overview>
Automates the setup of git submodule architecture with fully automated parent-child synchronization via GitHub Actions. Transforms branch-based content separation into always-present submodule directories, eliminating context-switching for agents and developers.
**Result:**
```
parent-repo/
├── src/
├── docs/ <- submodule (always present)
└── exports/ <- submodule (always present)
```
</overview>
<tool_usage>
## Tool Usage Guide
Use these tools for each operation type:
| Operation | Tool | Parallelization |
|-----------|------|-----------------|
| Collect parameters | `AskUserQuestion` | Single call with all parameters |
| Create GitHub repos | `Bash` | Parallel - no dependencies between repos |
| Set secrets | `Bash` | Parallel - no dependencies between repos |
| Deploy workflow files | `Write` | Parallel - independent files |
| Run git commands | `Bash` | Sequential within phase, parallel across unrelated ops |
| Validate setup | `Bash` | Sequential - each check depends on prior state |
| Read/write state | `Read`/`Write` | As needed for checkpoint operations |
**Parallel execution rule:** If two or more commands have no dependencies between them, execute them in a single message with multiple tool calls.
</tool_usage>
<manual_intervention>
## Manual Intervention Protocol
Some steps require human action in a browser (cannot be automated via CLI). When you reach these steps:
### Handoff Protocol
1. **Announce the handoff** - Clearly state what manual action is needed
2. **Provide direct URL** - Give the exact URL to navigate to
3. **List exact steps** - Number each click/selection in order
4. **Specify what to copy back** - Tell user what value to provide after
5. **Wait explicitly** - Use `AskUserQuestion` to pause until user confirms
6. **Verify completion** - Run CLI command to confirm the manual step worked
### Manual Steps in This Skill
| Phase | Manual Action | URL |
|-------|---------------|-----|
| Phase 3 | Create Fine-Grained PAT | `https://github.com/settings/personal-access-tokens/new` |
| Phase 6 | Configure GitHub Pages (if needed) | `https://github.com/{owner}/{repo}/settings/pages` |
### Example Handoff Message
```
I need you to create a Personal Access Token in the browser.
**URL:** https://github.com/settings/personal-access-tokens/new
**Steps:**
1. Click "Generate new token"
2. Token name: `submodule-sync-myproject`
3. Expiration: Select "90 days"
4. Repository access: Click "Only select repositories"
5. Select: `myorg/parent-repo` (and each submodule repo if using Pull Model)
6. Permissions → Repository permissions → Contents: "Read and write"
7. Click "Generate token"
8. **Copy the token** (starts with `github_pat_`)
Paste the token below when ready.
```
### After Manual Step
Always verify the manual action succeeded:
```bash
# After PAT creation - test it works
gh auth status # or test API call with new token
# After GitHub Pages config
gh api repos/{owner}/{repo}/pages --jq '.source'
```
</manual_intervention>
<state_schema>
## State File Schema
Location: `.submodule-setup-state.json` in parent repo root.
Use `Read` tool to check for existing state on resume. Use `Write` tool to update after each phase.
```json
{
"version": "1.0",
"started_at": "2026-01-13T10:30:00Z",
"current_phase": 2,
"params": {
"PARENT_REPO": "org/repo",
"SUBMODULE_NAMES": ["docs", "exports"],
"TARGET_DIRS": ["docs", "exports"],
"DEFAULT_BRANCH": "dev",
"SOURCE_BRANCHES": [],
"SOURCE_PATHS": []
},
"phases": {
"0": { "status": "completed", "backup_branch": "backup/pre-submodule-setup-20260113-103000" },
"1": { "status": "completed" },
"2": { "status": "in_progress", "repos_created": ["org/repo-docs"], "repos_pending": ["org/repo-exports"] }
},
"audit_log": [
{ "event": "phase_started", "phase": 0, "timestamp": "2026-01-13T10:30:00Z" },
{ "event": "backup_created", "branch": "backup/pre-submodule-setup-20260113-103000", "timestamp": "2026-01-13T10:30:05Z" }
]
}
```
**Resume logic:** If state file exists, read `current_phase` and skip completed phases. Resume from `in_progress` phase using saved progress data.
</state_schema>
<escalation_defaults>
## Default Escalation Rules
These patterns apply to all phases unless overridden:
| Error Pattern | Action | Max Retries |
|---------------|--------|-------------|
| `rate limit` | Retry with exponential backoff | 3 |
| `network error` / `timeout` | Retry | 3 |
| `already exists` | Ask user: use existing, rename, or abort | - |
| `permission denied` | Abort with auth instructions | 0 |
| `not found` | Ask user to verify input | - |
| Unknown error | Abort and report | 0 |
**Abort behavior:** On abort, update state file with `"status": "failed"` and error details. Do not delete state file - it aids debugging.
</escalation_defaults>
## Prerequisites
Before starting, run the validation script:
```bash
~/.claude/skills/submodule-setup/scripts/validate-prerequisites.sh
```
**Required:**
- GitHub CLI (`gh`) installed and authenticated
- Git 2.x+
- Repository with push access
- Ability to create fine-grained PAT
<workflow>
## Workflow
```
Phase 0: Backup → Phase 1: Parameters → Phase 2: Create Repos → Phase 3: PAT/Secrets
↓
Phase 10: Validate ← Phase 9: Docs ← Phase 8: Hooks ← Phase 7: Scripts ← Phase 6: Actions
↑
Phase 5: Add Submodules ← Phase 4: Migrate (conditional)
```
<decision_criteria id="phase4">
**Phase 4 Decision:**
- Execute Phase 4 if: User provided `SOURCE_BRANCHES` in Phase 1
- Skip Phase 4 if: `SOURCE_BRANCHES` is empty or user says "start fresh"
</decision_criteria>
<resume_behavior>
**On Resume:**
1. Read `.submodule-setup-state.json`
2. Find phase with `"status": "in_progress"`
3. Use phase-specific progress data to continue (e.g., `repos_created` list)
4. If no in_progress phase, start from first `"status": "pending"` phase
</resume_behavior>
</workflow>
---
<phase name="0" title="Backup Checkpoint">
<progress>
<status_key>phase_0_backup</status_key>
<on_start>Creating backup checkpoint</on_start>
<on_complete>Backup created: {backup_branch}</on_complete>
</progress>
<escalation>
<abort>
<condition>working tree is dirty</condition>
<message>Working tree has uncommitted changes. Commit or stash before proceeding.</message>
</abort>
<abort>
<condition>script not found</condition>
<message>Skill not installed correctly. Verify ~/.claude/skills/submodule-setup/ exists.</message>
</abort>
</escalation>
<checkpoint>
<on_complete>
Write to state file:
- "current_phase": 0
- "phases.0.status": "completed"
- "phases.0.backup_branch": "{created_branch_name}"
</on_complete>
</checkpoint>
<audit>
<event name="backup_created">
<fields>branch, timestamp</fields>
</event>
</audit>
## Phase 0: Backup Checkpoint
**Before any modifications**, create recovery point:
```bash
~/.claude/skills/submodule-setup/scripts/create-backup.sh /path/to/parent-repo
```
This script:
- Verifies working tree is clean (aborts if dirty)
- Creates timestamped backup branch
- Saves rollback instructions to `.submodule-setup-backup`
<verification>
**Verification:** Confirm backup branch exists:
```bash
git branch --list 'backup/pre-submodule-setup-*'
```
Expected: At least one matching branch. Do not proceed until backup exists.
</verification>
<error_recovery>
**If this fails:**
- If working tree is dirty: commit or stash changes first
- If script not found: verify skill installation at `~/.claude/skills/submodule-setup/`
</error_recovery>
**Rollback procedure** (if setup fails mid-way):
```bash
# Reset parent repo to pre-submodule state
git reset --hard backup/pre-submodule-setup-<timestamp>
git submodule deinit -f -Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.