adopt
Bootstrap an existing repo for ForgeDock — triage open issues, apply labels, suggest a starter milestone, and identify first…
AI-powered forge.yaml config generator — scans codebase, queries GitHub, auto-fills all optional sections from detection
> /plugin marketplace add RapierCraftStudios/ForgeDock > /plugin install forgedock@forgedock
How it fires
How this command gets triggered: by you, by Claude, or both.
/forgedock-initContext preview
What this command does when you run it.
AI-powered forge.yaml config generator — scans codebase, queries GitHub, auto-fills all optional sections from detection
description: AI-powered forge.yaml config generator — scans codebase, queries GitHub, auto-fills all optional sections from detection argument-hint: "[--preserve | --interactive | --section <name> | --domain-labels <a,b,c>]"
<!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios --> <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
**Input**: $ARGUMENTS
You complete the `forge.yaml` configuration that `npx forgedock init` started. The CLI generates required sections (project, paths, branches) from auto-detection. Your job is to scan the codebase, query GitHub APIs, and produce a complete `forge.yaml` with every applicable optional section filled — using detected values directly, without asking for confirmation.
**Agent model policy**: `model: "{DEFAULT_MODEL}"` — resolved from forge.yaml `agents.default_model`, else "sonnet" (standard tier). Fallback: `model: "opus"` if rate-limited. Feature gate: pass `effort` in Task/Skill spawns only on Claude Code >= 2.1.154. **NEVER use plan mode (EnterPlanMode).**
---
| Flag | Effect | |------|--------| | (none) | Fill all optional sections — overwrite existing values with newly detected ones, skip sections with nothing detected | | `--preserve` | Keep existing active section values unchanged — only fill sections that are not yet configured | | `--interactive` | Ask confirmation for every detected value and present menus for optional features | | `--section <name>` | Fill only one section: `repos`, `project_board`, `services`, `review`, `verification`, or `labels` | | `--domain-labels <a,b,c>` | Domain labels to bootstrap on the repo (e.g. `frontend,backend,infra,design,legal-gated`) in addition to `bin/labels.json`. Overrides the list Phase 5E derives from the spec. |
Parse `$ARGUMENTS` and set:
PRESERVE = true if --preserve present INTERACTIVE = true if --interactive present (restores full questionnaire behavior for all sections) TARGET_SECTION = value from --section <name>, or "all" DOMAIN_LABELS = value from --domain-labels <a,b,c>, or "" (derived in Phase 5E)
If both `--preserve` and `--interactive` are present, `--interactive` takes precedence (`PRESERVE = false`).
If `--section` was provided, validate the value immediately:
ALLOWED_SECTIONS="repos project_board services review verification labels"
if [ "$TARGET_SECTION" != "all" ]; then
VALID=false
for s in $ALLOWED_SECTIONS; do
[ "$TARGET_SECTION" = "$s" ] && VALID=true && break
done
if [ "$VALID" = "false" ]; then
echo "Error: '$TARGET_SECTION' is not a valid section name."
echo ""
echo "Valid sections: repos, project_board, services, review, verification, labels"
echo ""
echo "Usage: /forgedock-init --section <name>"
exit 1
fi
fi---
FORGE_YAML="$(pwd)/forge.yaml" if [ ! -f "$FORGE_YAML" ]; then echo "forge.yaml not found in current directory." echo "" echo "Run first: npx forgedock init" echo "" echo "This generates the required skeleton (project, paths, branches)." echo "Then re-run /forgedock-init to complete the optional sections." exit 1 fi cat "$FORGE_YAML"
Parse these from the existing file — they are needed for all subsequent queries:
OWNER = project.owner REPO = project.repo REPO_ROOT = paths.root
After extracting these values, validate that OWNER and REPO are non-empty and do not contain placeholder values. If placeholders are found, attempt auto-detection from the git remote before erroring:
OWNER_IS_PLACEHOLDER=false
REPO_IS_PLACEHOLDER=false
[ -z "$OWNER" ] || [ "$OWNER" = "your-github-org" ] && OWNER_IS_PLACEHOLDER=true
[ -z "$REPO" ] || [ "$REPO" = "your-repo-name" ] && REPO_IS_PLACEHOLDER=true
if [ "$OWNER_IS_PLACEHOLDER" = "true" ] || [ "$REPO_IS_PLACEHOLDER" = "true" ]; then
echo "Placeholder values detected in forge.yaml — attempting auto-detection from git remote..."
REMOTE_URL=$(git -C "$REPO_ROOT" remote get-url origin 2>/dev/null || true)
DETECTED_OWNER=""
DETECTED_REPO=""
if [ -n "$REMOTE_URL" ]; then
# SSH format: git@github.com:owner/repo.git
if echo "$REMOTE_URL" | grep -qE '^git@[^:]+:'; then
DETECTED_OWNER=$(echo "$REMOTE_URL" | sed -E 's|^git@[^:]+:([^/]+)/.*|\1|')
DETECTED_REPO=$(echo "$REMOTE_URL" | sed -E 's|^git@[^:]+:[^/]+/||; s|\.git$||')
# HTTPS format: https://github.com/owner/repo.git
elif echo "$REMOTE_URL" | grep -qE '^https?://'; then
DETECTED_OWNER=$(echo "$REMOTE_URL" | sed -E 's|^https?://[^/]+/([^/]+)/.*|\1|')
DETECTED_REPO=$(echo "$REMOTE_URL" | sed -E 's|^https?://[^/]+/[^/]+/||; s|\.git$||')
fi
fi
if [ -n "$DETECTED_OWNER" ] && [ -n "$DETECTED_REPO" ]; then
echo "Auto-detected: owner=\"$DETECTED_OWNER\" repo=\"$DETECTED_REPO\""
# Update forge.yaml in-place with detected values
[ "$OWNER_IS_PLACEHOLDER" = "true" ] && \
sed -i '/^project:/,/^[a-z]/{s|^ owner:.*| owner: "'"$DETECTED_OWNER"'"|}' "$FORGE_YAML"
[ "$REPO_IS_PLACEHOLDER" = "true" ] && \
sed -i "s|^ repo:.*| repo: \"$DETECTED_REPO\"|" "$FORGE_YAML"
echo "forge.yaml updated with auto-detected values. Continuing..."
# Re-read the corrected values
OWNER="$DETECTED_OWNER"
REPO="$DETECTED_REPO"
else
echo "Error: project.owner/project.repo contain placeholder values and auto-detection failed."
echo ""
echo "Could not detect owner/repo from git remote. Open forge.yaml and fill in the 'project:' section:"
echo " project:"
echo " owner: \"your-actual-github-org-or-username\""
echo " repo: \"your-actual-repo-name\""
echo ""
echo "Then re-run /forgedock-init."
exit 1
fi
fiFor each optional section, check if it has an UNCOMMENTED entry in the file. A commented-out section (all lin
ForgeDock — autonomous AI dev pipeline for Claude Code. GitHub as agent memory: issue in, PR out.
Bootstrap an existing repo for ForgeDock — triage open issues, apply labels, suggest a starter milestone, and identify first…
Pull production analytics from GSC, Bing Webmaster, Clarity, Umami, Cloudflare, Stripe, and GA4 — generate insights and create…
Audit agent outputs from an orchestration run — timeline analysis, stall detection, active vs idle time breakdown
Trace a production issue or pipeline failure end-to-end through GitHub artifacts, then file a detailed improvement issue to the…
Autonomous deploy loop — runs until zero open issues remain. Detects pipeline state and resumes from any position. Fully…
Guided idea-to-backlog setup for a brand-new project — interview, defaults, doubts, spike doc, validated orchestrate-ready backlog