Skip to content

nexu-io/open-design / .claude/skills/od-contribute

od-contribute

Unverified

One-click contribution flow for OpenDesign (nexu-io/open-design) — even for non-coders. Pick one of four cards (ship a Skill or Design System you made with OD; translate docs; fix a typo / write a blog; report a bug), the agent validates and opens a PR (or issue) for you. Trigger words contribute to open design, ship my OD skill, ship my OD design system, translate OD docs, report an OD bug, od-contribute.

FileKindSize
SKILL.mdskill md13.8 KB
agents/openai.yamlconfig650 B
install.shexecutablescript5.1 KB
references/design-system-anatomy.mdmarkdown2.0 KB
references/newcomer-tone.mdmarkdown2.7 KB
references/od-repo-map.mdmarkdown2.2 KB
references/skill-anatomy.mdmarkdown2.3 KB
scripts/check-prereqs.shexecutablescript4.1 KB
scripts/config.shexecutablescript2.4 KB
scripts/create-issue.shexecutablescript3.7 KB
scripts/create-pr.shexecutablescript3.8 KB
scripts/discover-doc-gaps.shexecutablescript4.0 KB
scripts/discover-i18n-gaps.shexecutablescript4.8 KB
scripts/setup-workspace.shexecutablescript3.4 KB
scripts/validate-design-system.shexecutablescript3.3 KB
scripts/validate-markdown.shexecutablescript6.9 KB
scripts/validate-skill-submission.shexecutablescript5.0 KB
templates/ISSUE-BODY-bug.mdmarkdown450 B
templates/PR-BODY-design-system.mdmarkdown1.1 KB
templates/PR-BODY-docs.mdmarkdown723 B
templates/PR-BODY-i18n.mdmarkdown1.2 KB
templates/PR-BODY-skill.mdmarkdown1016 B

scripts/create-pr.sh

View on GitHub
#!/usr/bin/env bash
# Commit, push, and open a PR against nexu-io/open-design.
# Usage: create-pr.sh --workdir <dir> --type <skill|design-system|i18n|docs> \
#                     --title "<pr title>" --body-file <rendered PR body .md>
#
# Reads:
#   <workdir>/.od-contrib/contributor.txt   (display name; optional)
#   <workdir>/.od-contrib/pitch.txt         (one-line pitch; optional)
# Emits PR URL on its own line at the end (stdout).

set -euo pipefail
source "$(dirname "$0")/config.sh"

WORKDIR=""
TYPE=""
TITLE=""
BODY_FILE=""
DRAFT=""

while (($#)); do
  case "$1" in
    --workdir)   WORKDIR="$2"; shift 2 ;;
    --type)      TYPE="$2"; shift 2 ;;
    --title)     TITLE="$2"; shift 2 ;;
    --body-file) BODY_FILE="$2"; shift 2 ;;
    --draft)     DRAFT="--draft"; shift ;;
    *) od::die "unknown flag: $1" ;;
  esac
done

[[ -n "$WORKDIR"   ]] || od::die "--workdir required"
[[ -n "$TYPE"      ]] || od::die "--type required (skill|design-system|i18n|docs)"
[[ -n "$TITLE"     ]] || od::die "--title required"
[[ -f "$BODY_FILE" ]] || od::die "--body-file does not exist: $BODY_FILE"
[[ -d "$WORKDIR/.git" ]] || od::die "not a git workdir: $WORKDIR"

od::require gh
od::require git

cd "$WORKDIR"
BRANCH="$(git rev-parse --abbrev-ref HEAD)"

case "$BRANCH" in
  main|master|develop) od::die "refusing to push base branch '$BRANCH'" ;;
esac

# 1) Stage + commit if there are changes. Use a non-jargon commit message.
#
# Use `git status --porcelain` rather than `git diff --quiet` because the latter
# ignores untracked files. The most common contribution shape — a brand-new
# Skill folder, translation file, or doc — is 100% untracked at this point;
# any predicate that misses untracked paths would silently push an empty PR.
#
# Belt-and-suspenders against the skill's internal scratch dir leaking into
# the user's contribution PR: setup-workspace.sh adds `.od-contrib/` to
# .git/info/exclude, but in case this script is invoked against a workdir
# set up differently, also pass `:!.od-contrib` as a pathspec exclude so
# nothing under .od-contrib/ gets staged here.
SCRATCH_EXCLUDE=':!:.od-contrib'
if [[ -n "$(git status --porcelain -- . "$SCRATCH_EXCLUDE")" ]]; then
  git add -A -- . "$SCRATCH_EXCLUDE"
  # If even after `git add` the index is clean (e.g., changes were only in
  # ignored paths or symlink mode bits), skip the commit instead of erroring.
  if git diff --cached --quiet; then
    od::log "no real changes after staging — skipping commit"
  else
    git commit -m "$TITLE"
    od::log "created commit"
  fi
else
  od::log "nothing new to commit (assuming work was already committed)"
fi

# 2) Decide push remote. Prefer fork.
PUSH_REMOTE="origin"
if [[ -n "${TARGET_FORK}" ]] && git remote | grep -q '^fork$'; then
  PUSH_REMOTE="fork"
else
  od::warn "no fork configured (TARGET_FORK empty) — pushing to upstream ${TARGET_REPO}. 3s to abort..."
  sleep 3 || true
fi

od::log "pushing to ${PUSH_REMOTE}/${BRANCH}"
git push -u "$PUSH_REMOTE" "$BRANCH"

# 3) Pick label set per contribution type. (OD's labels: documentation, i18n, blog, enhancement, ...)
LABELS=()
case "$TYPE" in
  skill)         LABELS+=("good first issue" "enhancement") ;;
  design-system) LABELS+=("good first issue" "enhancement") ;;
  i18n)          LABELS+=("i18n" "documentation") ;;
  docs)          LABELS+=("documentation") ;;
esac

LABEL_FLAGS=()
for L in "${LABELS[@]}"; do
  LABEL_FLAGS+=(--label "$L")
done

# 4) Open the PR. `gh pr create` automatically picks `head` from the pushed branch.
HEAD_REF="$BRANCH"
if [[ "$PUSH_REMOTE" == "fork" && -n "$TARGET_FORK" ]]; then
  HEAD_REF="${TARGET_FORK%%/*}:${BRANCH}"
fi

PR_URL="$(gh pr create \
  --repo "$TARGET_REPO" \
  --base "$OD_BASE_BRANCH" \
  --head "$HEAD_REF" \
  --title "$TITLE" \
  --body-file "$BODY_FILE" \
  ${DRAFT} \
  "${LABEL_FLAGS[@]}")" || od::die "gh pr create failed"

printf '\n'
printf '%s\n' "$PR_URL"
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall