协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
core-onboarding【开发与工程】Use this skill when the user says 'onboarding', 'new developer', 'new team member', 'setup guide', 'getting started', 'dev environment setup', 'new joiner', 'ramp up'. Produces a structured onboarding plan and environment setup guide for new team members. Do NOT use for: project initialization or README writing.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Accelerate new team member ramp-up through structured Day 1 / Week 1 onboarding. Covers environment setup, architecture overview, development workflow, and team practices so new joiners ship their first code change by end of week one.
Great onboarding is a competitive advantage for engineering organizations. New hires who ship their first PR within the first week reach full productivity faster and are retained at higher rates. Every hour invested in onboarding saves dozens of hours across future new hires. The feedback loop: every new hire who finds missing documentation and fixes it as their first PR creates a self-improving system.
"onboarding", "new developer", "new team member", "setup guide", "getting started", "dev environment setup", "new joiner", "ramp up"
Onboarding plan with day-by-day checklist, environment setup commands in executable order, architecture overview with key directories and request flow, and team practices reference guide.
Complete onboarding checklist verified. Dev server running (health endpoint HTTP 200). New developer can describe request flow from memory. First PR created, reviewed, and merged to main.
3000 tokens
Before developer arrives: send GitHub/GitLab invite, provision cloud IAM (read-only), create shared credential entry, block buddy's calendar for pairing. Developer: clone repo, read README, run setup script. Buddy pairs on first setup run. End of day: dev server running, health endpoint returns 200. Any missing step → file as issue → developer's first Day 2 task.
Buddy or tech lead leads 60-min walkthrough: directory structure (src, tests, docs, scripts, infra), request flow client→DB→back, deployment pipeline (commit→CI→build→staging→prod), event/message topology (queues, topics, streams), key infra dependencies (DBs, caches, search, CDNs). Developer draws request flow from memory at end. Gaps inform Day 3 focus.
Pick small, well-scoped ticket (docs fix, minor bug, small feature with clear AC). Buddy pairs on full workflow: branch from main, make change, write tests, run suite locally, push, open draft PR. Focus on workflow correctness (branch name, commit messages, PR format, CI) not code quality. End of day: draft PR exists with green CI.
Buddy + second reviewer perform thorough review: logic, correctness, design, security, tests. Developer responds to each comment, pushes fixes. Buddy ensures developer understands every comment. PR merged with team's standard strategy (squash by default). Developer verifies change in staging.
Developer writes brief retro: what was confusing, what was most helpful, what docs were wrong/missing, week 2 plan. EM + buddy review, prioritize top 3 improvements. Developer assigned first independent ticket (still small, well-scoped). Buddy transitions from active pairing to async support.
Welcome to the team! Your onboarding buddy is {buddy_name}.
- Day 1: Environment setup — goal: health endpoint returns 200
- Day 2: Architecture tour — goal: draw request flow from memory
- Day 3: First code change — goal: draft PR open with green CI
- Day 4: PR review and merge — goal: first PR merged to main
- Day 5: Retro and planning — goal: documented learnings + next ticket
Setup approach:
├── .devcontainer.json exists?
│ ├── YES → Offer devcontainer option (eliminates env variance)
│ └── NO → Native setup (check prerequisites first)
├── Install runtime:
│ ├── .tool-versions → asdf (recommended for polyglot repos)
│ ├── .nvmrc → nvm
│ ├── .python-version → pyenv
│ └── .ruby-version → rbenv
├── Install dependencies:
│ ├── package-lock.json → npm ci
│ ├── pnpm-lock.yaml → pnpm install --frozen-lockfile
│ ├── Cargo.lock → cargo build
│ ├── go.sum → go mod download
│ └── requirements.txt → pip install -r requirements.txt
├── Configure env:
│ ├── .env.example exists → cp to .env, fill each var
│ └── No .env.example → create one as first contribution
└── Verify:
├── Health endpoint → HTTP 200
└── Test suite → all passing
Produce step-by-step instructions as executable command blocks in strict order. Clone → install runtime → install deps → configure env → start dev server → verify health → run tests. If project lacks bin/setup or equivalent automation, create one as part of onboarding PR.
Walk directory structure. src/ or app/ = application source by feature module or bounded context. tests/ or spec/ = all automated tests mirroring source. docs/ = ADRs, API docs, runbooks, diagrams. scripts/ = automation (setup, DB ops, deploy). infra/ or ops/ = IaC (Terraform, K8s, CloudFormation, Docker Compose). Describe request flow: CDN → load balancer → API gateway (routing + auth) → service → DB (optional cache) → optional queue → response. Deployment pipeline: push → CI (lint, typecheck, unit, int, security, build) → registry → staging → smoke tests → prod (blue-green or canary).
Branch strategy: all feature branches from main (never other feature branches). Naming: feature/user-login, fix/PROJ-123-null-pointer, chore/upgrade-deps. PR workflow: draft PR early for intent signal → self-review before requesting → request reviewers → address feedback with additional commits (no force-push during review) → squash merge. CI: every push triggers lint → typecheck → unit → integration → security scan → build. Fix failures at each stage before proceeding. Testing: features need unit tests, bug fixes need reproduction test, API changes need integration tests, critical paths need E2E. Min 80% coverage on new code. Code review culture: respond within 4 business hours, focus on logic/correctness/design/security (linters handle style), explicit approve or request changes (no passive comments-only).
Standup: same time daily, same platform, same format (yesterday/today/blocks), ≤15 min for teams ≤10. Communication: Slack/Discord by topic channels (#engineering, #incidents, #releases), scheduled video for agile ceremonies, GitHub for code discussions, dedicated on-call channel. Documentation conventions: ADRs per template (title, status, context, decision, consequences) as markdown with sequential ID in docs/adr/. API docs as OpenAPI alongside source. Architecture diagrams in docs/diagrams/ (Mermaid, Draw.io, Excalidraw). Runbooks in docs/runbooks/ (deploy, rollback, incident response, troubleshooting).
| Day | Goal | How to Verify |
|---|---|---|
| Day 1 end | Dev environment fully running | Health endpoint returns HTTP 200 |
| Day 2 end | Architecture understood at high level | Can describe request flow without notes |
| Day 3 end | First meaningful code change made | Draft pull request is open |
| Day 5 end | First pull request merged to main | PR merged with all checks green |
| Role | Pre-Start | Day 1 | Week 1 | Week 2+ |
|---|---|---|---|---|
| EM | Provision access, assign buddy | Welcome, team intro | Weekly 1:1 | Normal cadence |
| Buddy | Block calendar, prepare pairing | Pair on setup + walkthrough | Pair on first PR, daily check-in | Async, tapering |
| Tech Lead | Prepare arch walkthrough | Architecture tour (60 min) | Review first PR | Normal rotation |
| DevOps | Verify IAM, vault access | Unblock setup issues | Monitor access needs | On-call shadowing |
| New Dev | Read project docs | Setup, first test run | First PR merged | First independent ticket |
bin/setup, make setup, npm run setup) takes from empty clone to running dev server. Non-automatable steps tracked as tech debt.| Time | Day 1 | Day 2 | Day 3 | Day 4 | Day 5 |
|---|---|---|---|---|---|
| 9:00-10:00 | Welcome + manager intro | Architecture walkthrough | Ticket selection + planning | PR review session | Retro writing |
| 10:00-12:00 | Environment setup pairing | Directory tour + request flow | First code change (pair) | Address review comments | Improvement tickets |
| 12:00-13:00 | Team lunch | Lunch | Lunch | Lunch | Lunch |
| 13:00-15:00 | First test suite run | CI/CD pipeline review | Write tests for change | Second reviewer feedback | First independent ticket |
| 15:00-17:00 | Health check + verify | Meeting the team | Open draft PR | Merge to main + verify | Week 2 planning |
| When | Who | Duration | Format |
|---|---|---|---|
| Daily 9:00 AM | Buddy + new hire | 15 min | Standup-style check-in |
| Day 1 4:00 PM | Manager + new hire | 30 min | How was day 1? |
| Day 3 3:00 PM | Buddy + new hire | 60 min | PR pairing session |
| Day 5 3:00 PM | Manager + buddy + hire | 30 min | Week 1 retro |
| Daily (async) | Buddy | 15 min | Slack check-in noon |
Before Day 1: block calendar Mon-Wed 9-12 and Thu-Fri 10-11, prepare scoped ticket with clear AC, review known setup issues, set up pairing environment (VS Code Live Share, tmux, Tuple). Day 1: pair on setup, document missing steps, guide through first test suite run, explain README + ARCHITECTURE.md. Days 2-3: walk request flow, explain deployment pipeline, pair on first code change + tests, guide through opening draft PR. Days 4-5: review first PR, explain each review comment, celebrate merge, lead retro.
After 4 weeks, final check-in. Buddy writes handoff note for manager: areas of strength, areas needing support, documentation improvements made, process improvement recommendations. Manager takes over as primary support.
Each retro produces actionable items: doc updates (assigned to buddy as ticket), process changes (escalated to EM for next sprint), tool improvements (infrastructure backlog), team practice updates (next retro/team meeting). After 3 new hires, review all findings for systemic issues.
For fully remote teams without synchronous pairing:
| Channel | Purpose | Norms |
|---|---|---|
| #onboarding | Public Q&A — anyone can answer | Search before asking. Answer publicly. |
| #dev-help | Technical blockers | Include error logs, steps tried, expected outcome. |
| Buddy DM | Private 1:1 check-ins | Daily 15-min async check-in first 2 weeks. |
| Weekly 1:1 | Manager + engineer | Career, team dynamics, feedback. Not technical. |
| Pairing calendar | Deep-dive sessions | Block 2x 2hr/week for optional pairing. |
Before onboarding a new engineer, ensure:
README.md has: prerequisites, setup steps, architecture overviewCONTRIBUTING.md has: PR process, code review checklist, commit conventionsdocs/architecture.md has: system diagram, key decisions, data flowdocs/setup.md has: exact commands, expected outputs, troubleshooting tabledocs/deployment.md has: CI/CD pipeline, environment promotion, rollback process.env.example has all required variables with descriptionsscripts/setup.sh (or equivalent) automates the entire setupBuddy responsibilities (first 4 weeks):
Senior engineer responsibilities (first 2 weeks):
Onboarding mentor rotation:
Node.js issues:
nvm use reads .nvmrc — check file existsnpm cache clean --force, reinstallnode_modules + package-lock.json → reinstall~/.npm-global/binDocker issues:
systemctl start docker (Linux), start Docker Desktop (macOS/Windows)lsof -i :PORT to find what's using the port:delegated on macOS for faster mountsdocker compose logs -f service-nameDatabase issues:
.env values, DB host, portnpx prisma migrate reset or npm run db:resetnpm run db:seed after migrationsnpm run db:reset — always safe in developmentPython issues:
source .venv/bin/activate (Linux/macOS), .venv\Scripts\Activate.ps1 (Windows)pip install -r requirements.txtpyenv local 3.12 reads .python-versionpip install --user or virtual environments alwaysWeek 1: Guided — buddy pairs on everything
Week 2: Supported — buddy reviews, but new hire drives
Week 3: Independent — own small tickets, ask when stuck
Week 4: Contributing — own features, contribute to design discussions
Month 2: Proficient — review others' PRs, mentor new hires
Month 3: Autonomous — lead features, influence architecture
Week 1 check-in questions:
Week 4 retrospective:
Metrics to track:
| Anti-Pattern | Why It Fails | Better Approach |
|---|---|---|
| Dump all docs on day 1 | Information overload — nothing is retained | Progressive disclosure: day 1 setup, day 2 workflow, week 2 architecture |
| No dedicated buddy | New hire ping-pongs between team members, no consistent support | Assign a primary buddy for first 4 weeks with a backup buddy |
| "Just read the code" | New hires don't know where to start or what matters | Provide guided tours: "Start in src/auth/, then src/api/, then..." |
| Skip setup automation | Every setup is unique, env drift, takes days | Automate with scripts, maintain .env.example, test setup fresh each quarter |
| No code review mentorship | Feedback feels personal, new hires get discouraged | Review PRs together live first 2 weeks, explain "why" not just "what" |
| First PR is too large | Overwhelming changes, lengthy review process | Break into 3 smaller PRs: scaffold, logic, tests |
| Ignoring diversity & inclusion | Assumptions about background, experience, learning style | Provide written + video + pairing options. Ask about pronouns. Respect time zones. |
| No ramp-down | Week 4 ends and new hire is on their own | Buddy support tapers: daily → every other day → weekly check-ins |
09:00 — Welcome call (manager + buddy)
- Team intro, communication channels, expectations
- Schedule recurring 1:1s (daily buddy check-in, weekly 1:1 with manager)
10:00 — Environment setup (self-paced + buddy available)
- Run automated setup script
- Verify clone, build, and test pass
- Pair on any blockers
12:00 — Lunch / break
13:00 — Codebase tour (buddy-led)
- monorepo structure overview
- Key entry points (main.ts, router, DB schema)
- "Where to find X" quick reference
15:00 — First PR preparation
- Create a branch, make a trivial change (update README)
- Open first PR
- Learn: branch naming, commit conventions, PR template
16:30 — Retro on day 1 (new hire + buddy)
- What was confusing?
- Update onboarding docs with any gaps found
Session 1 — Editor mastery (buddy demos)
- Debugger configuration and usage
- Snippets, multi-cursor, find/replace patterns
- Integrated terminal workflows
- Git integration (blame, history, stash)
Session 2 — CI/CD pipeline walkthrough
- Commit → CI → Review → Merge → Deploy flow
- How to read CI logs, rerun failed jobs
- Feature flags and canary deployments
- Rollback procedure
Session 3 — Testing culture
- Where tests live, naming conventions
- Run the full test suite
- Write a unit test + integration test (guided)
- Learn: mocking strategy, test fixtures, snapshot review
Session 4 — Debugging hands-on
- Buddy introduces a known bug in a sandbox branch
- New hire debugs it: read logs, set breakpoints, fix
- Learn: error tracking tool, logging system, local debug workflow
Day 1 — Small bug fix (assigned, scoped)
- New hire independently picks up a labeled "good-first-issue"
- Buddy reviews PR, explains reasoning behind comments
- Goal: ship the fix by end of day
Day 2 — Architecture deep-dive (senior engineer)
- 1-hour whiteboard session on system architecture
- Covers: bounded contexts, events, data flow, key ADRs
- Recorded for future hires
Day 3 — First feature (part 1)
- Feature with clear scope: 1 API endpoint + 1 UI component
- Pair on design review (whiteboard approach before coding)
- Implement endpoint (independent)
Day 4 — First feature (part 2)
- Implement UI component
- Write tests for both
- Open PR for review
Day 5 — First feature (part 3)
- Address PR feedback
- Feature flag configuration and testing
- Deploy to staging, verify, get sign-off
- Celebrate first shipped feature
# Package manager
winget install Microsoft.PowerShell
winget install Git.Git
winget install OpenJS.NodeJS.LTS
winget install Docker.DockerDesktop
winget install Microsoft.VisualStudioCode
# WSL2 (for Docker compatibility)
wsl --install -d Ubuntu-24.04
# Path configuration (add these to $PROFILE)
$env:Path += ";$env:USERPROFILE\AppData\Roaming\npm"
$env:Path += ";$env:USERPROFILE\.local\bin"
# Homebrew (package manager)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Core tools
brew install git node pnpm docker colima gh
brew install --cask visual-studio-code
# ASDF (version manager for all languages)
brew install asdf
asdf plugin add nodejs && asdf install nodejs latest
asdf plugin add python && asdf install python latest
asdf global nodejs latest
asdf global python latest
# System packages
sudo apt update && sudo apt install -y \
git curl wget build-essential docker.io docker-compose-v2
# Node.js via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# pnpm
curl -fsSL https://get.pnpm.io/install.sh | sh -
# VS Code
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/packages.microsoft.gpg
sudo apt install -y code
## Review Checklist
### Correctness
- [ ] Does the code do what the ticket describes?
- [ ] Are edge cases handled (empty state, error state, loading state)?
- [ ] Are there tests for success and failure paths?
- [ ] Does the change break existing tests?
### Design & Architecture
- [ ] Does this follow the team's patterns (file structure, naming, exports)?
- [ ] Is the change at the right abstraction level?
- [ ] Could this be simpler? Fewer files, fewer conditionals?
- [ ] Are there unnecessary dependencies introduced?
### Security & Performance
- [ ] Are user inputs validated and sanitized?
- [ ] Are there N+1 queries or missing database indexes?
- [ ] Are secrets handled properly (env vars, not hardcoded)?
### Maintainability
- [ ] Are variable/function names clear?
- [ ] Is the change easy to revert?
- [ ] Would a teammate understand this in 6 months?
.env requirements — never commit secrets# Git secrets pre-commit hook
# Prevent committing passwords, keys, tokens
git secrets --install
git secrets --register-aws
# Or use gitleaks for CI scanning
# .gitleaks.toml
[allowlist]
description = "False positive exceptions"
paths = [
"test/fixtures/",
"*.test.ts"
]
| Stack | Common Issue | Fix |
|---|---|---|
| Node.js | EACCES: permission denied for global install | Use nvm or pnpm setup — never sudo npm install -g |
| Node.js | Module not found after pull | rm -rf node_modules && pnpm install |
| Docker | Volume mounts empty on macOS | Add :delegated suffix to mount: ./src:/app/src:delegated |
| Docker | Port already allocated | `lsof -ti:3000 |
| Python | pip install fails with SSL | Upgrade pip: pip install --upgrade pip setuptools wheel |
| Python | ModuleNotFoundError | Ensure virtual env is activated and pip install -e . for local packages |
| Rust | linker cc not found | Install build tools: brew install llvm (macOS), apt install build-essential (Linux) |
| Rust | Slow compile times | Use mold linker, cargo-chef for Docker builds |
| Java | Unsupported class file major version | Mismatched JDK version — use sdk use java 21.0.1 |
| Kubernetes | context was canceled | Check kubeconfig context: kubectl config current-context, increase --request-timeout |
| PostgreSQL | role "user" does not exist | createuser -s postgres or set PGUSER=postgres in .env |
| Redis | NOAUTH Authentication required | Set REDIS_PASSWORD in .env or disable password in dev |
| Git | fatal: refusing to merge unrelated histories | git pull origin main --allow-unrelated-histories (one-time) |
| Tool | Use Case | Notes |
|---|---|---|
| VS Code Live Share | Real-time collaborative editing | Each developer keeps own environment, extensions, themes |
| Tuple | Low-latency screen sharing | No audio echo, 4K, macOS-first |
| tmux (terminal) | Shared terminal session | Free, works over SSH, persistent sessions |
| FigJam / Miro | Whiteboard collaboration | System design, architecture diagrams, brainstorming |
| Slack huddle | Quick voice calls | Low friction, integrates with Slack threads |
For teams across 8+ time zones:
Onboarding documents should be updated after each new hire:
core-context-compressor — summary of setup knowledge, architecture understanding, and config for continuing work