一键导入
align
Align a project to brana practices — assess gaps, plan, implement, verify. Auto-detects type. Use when setting up a new project or realigning an existing one.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Align a project to brana practices — assess gaps, plan, implement, verify. Auto-detects type. Use when setting up a new project or realigning an existing one.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End a session — extract learnings, write handoff, store patterns, detect doc drift. Use when ending a work session or when the user says done/bye/closing.
Build anything — features, bug fixes, refactors, spikes, migrations. Auto-detects strategy, integrates with backlog, enforces TDD. The unified dev command.
Scan and diagnose a project, or scaffold a new client from scratch. Works for code and venture clients. Auto-detects project type.
Manage the backlog — plan, track, navigate phases and streams. Use when planning phases, viewing roadmaps, or restructuring work.
Structured bug fix — reproduce (failing test), diagnose, fix (minimal change), verify, commit. Enforces test-first. Use when a bug needs a methodical fix.
Unified maintenance — detect drift, run security checks, cascade spec propagation, knowledge hygiene. Scoped via --scope flag. Default: consistency.
| name | align |
| description | Align a project to brana practices — assess gaps, plan, implement, verify. Auto-detects type. Use when setting up a new project or realigning an existing one. |
| effort | medium |
| model | sonnet |
| keywords | ["alignment","structure","conventions","gaps","brana-practices"] |
| task_strategies | ["refactor","greenfield"] |
| stream_affinity | ["roadmap","tech-debt"] |
| argument-hint | [project-path] |
| group | execution |
| depends_on | ["onboard"] |
| allowed-tools | ["Bash","Read","Write","Edit","Glob","Grep","AskUserQuestion","Task","TaskList","EnterPlanMode","ExitPlanMode","Skill"] |
| status | stable |
| growth_stage | evergreen |
DISCOVER → ASSESS → PLAN → IMPLEMENT → VERIFY → DOCUMENT.
Creates files, configures structure, and implements practices. Unlike /brana:onboard (diagnostic, read-only), this skill actively builds. Replaces /project-align and /venture-align.
Initial setup of a new project, or when an existing project needs structural alignment. Run /brana:onboard first for the diagnostic — /brana:align implements what /brana:onboard finds.
On entry, create a CC Task step registry. Follow the guided-execution protocol.
Register these steps: DISCOVER, ASSESS, PLAN, IMPLEMENT, VERIFY, DOCUMENT.
Plan mode: Enter plan mode for DISCOVER and ASSESS (read-only diagnostic phases). Exit plan mode before IMPLEMENT.
Before assessment, gather context. This shapes tier, CLAUDE.md content, and implementation depth.
Ask what can't be inferred. Skip what's obvious from the codebase.
Same detection as /brana:onboard: check for manifests (code) and venture dirs/keywords (venture). Classify as code, venture, or hybrid.
Before applying the venture or code checklist, check for content-only repos:
total=$(find . -not -path '*/.*' -type f | wc -l)
md=$(find . -not -path '*/.*' -name '*.md' -type f | wc -l)
has_src=$([ -d src ] && echo 1 || echo 0)
has_manifest=$(ls package.json Cargo.toml pyproject.toml setup.py go.mod 2>/dev/null | wc -l)
Classify as brainstorm if:
src/ directory AND no manifest files AND >80% of files are .mdtype: brainstorm declared in .claude/CLAUDE.mdOn brainstorm detection: Auto-select Foundation-only scope: F1, F5, F6, .gitignore. Skip venture/code checklists entirely. Log to user:
"Brainstorm/research repo detected (no src/, no manifests, >80% markdown). Applying Foundation-only scope (F1, F5, F6, .gitignore). Override with 'full venture' or 'full code' to run the complete checklist."
Offer override before proceeding.
Spawn the client-scanner (code) or venture-scanner (venture) agent. If unavailable, run manually.
| Group | Items |
|---|---|
| Foundation (F1-F7) | Git, CLAUDE.md, rules, conventional commits, inbox, attribution, memory seed + MCP |
| SDD (S1-S5) | docs/architecture/decisions/, ADR, PreToolUse hook, /decide, spec-first |
| DDD (D1-D4) | Glossary, bounded contexts, ubiquitous language, model |
| TDD (T1-T4) | Test framework, runner, tdd-guard, coverage |
| Quality (Q1-Q4) | Linter, CI, security, code review |
| PM & Memory (P1-P5) | Issues, patterns, portfolio, recall, memory hygiene |
| Verification (V1-V3) | Hook fires, tests pass, alignment report |
| Group | Items |
|---|---|
| Foundation (F1-F5) | Description, decision log, metrics, cadence, inbox |
| Validation (V1-V5) | Hypothesis, MVP, experiments, burn rate, referrers |
| Growth (G1-G5) | OKRs, SOPs, meetings, hiring, decision framework |
| Scale (S1-S5) | Org chart, dept OKRs, automation, dashboard, onboarding |
Each item: present, partial, missing. Output gap report with visual progress bars.
Items are stage-cumulative. Only implement up to the current stage.
Present the plan and wait for user approval.
Execute item by item. Ask for confirmation before each major step.
F1 — Git: Skip if .git/ exists.
F2 — CLAUDE.md: Create/merge .claude/CLAUDE.md with project description, stack, conventions, domain.
Merge-safety (errata #140): Before appending any ## Section, grep the existing file for that heading. If it already exists, merge content under it — do not create a duplicate heading. Flag conflicts to the user.
grep -q "^## Docs" .claude/CLAUDE.md 2>/dev/null && echo "heading exists — merge" || echo "heading missing — append"
Content constraints (errata #141): Apply claudemd.md Step 2 include/exclude rules when writing CLAUDE.md content. Specifically omit:
Goal: CLAUDE.md should be <60 lines after F2. If it exceeds 80 lines, run /brana:claudemd audit before proceeding to VERIFY.
F3 — Rules: Copy relevant rules from ~/.claude/rules/. Stack-specific rules get path scoping.
Feed coverage check (ADR-055, code projects only): after the stack is recorded in F2, diff it against brana feed list — a tech is covered when a registered feed name starts with its slug (fuzzy prefix: supabase matches supabase-changelog). Offer brana feed add <url> --name <tech-slug>-changelog for major uncovered technologies in one multiSelect question. Advisory; skip silently if brana is unavailable. Full procedure: brana-feed-inbox guide.
F4 — Commits: Document conventional commits in CLAUDE.md.
F5 — Inbox: Ensure inbox/ exists and is gitignored. Create if missing:
mkdir -p inbox
# Add to .gitignore if not already present
grep -q '^inbox/' .gitignore 2>/dev/null || echo 'inbox/' >> .gitignore
F6 — Attribution: Ensure .claude/settings.local.json suppresses CC attribution lines (undercover mode). Merge if file exists; create if not:
mkdir -p .claude
SETTINGS=".claude/settings.local.json"
if [ -f "$SETTINGS" ]; then
# Merge attribution block into existing file (python3 safe JSON merge)
uv run python3 -c "
import json, sys
with open('$SETTINGS') as f:
s = json.load(f)
s.setdefault('attribution', {})
s['attribution']['commit'] = ''
s['attribution']['pr'] = ''
with open('$SETTINGS', 'w') as f:
json.dump(s, f, indent=2)
print('merged')
"
else
echo '{"attribution":{"commit":"","pr":""}}' | uv run python3 -c "
import json,sys; print(json.dumps(json.load(sys.stdin), indent=2))
" > "$SETTINGS"
echo 'created'
fi
Skip if .claude/settings.local.json already has both attribution.commit and attribution.pr set to "".
F7 — Memory seed & MCP availability:
.claude/memory/MEMORY.md exists; if missing: mkdir -p .claude/memory && echo "# Memory Index — {slug}" > .claude/memory/MEMORY.md (link CLAUDE.md and key docs).claude mcp list | grep -E "brana|ruflo". They are registered at user scope in ~/.claude.json (bootstrap.sh Step 6b). If missing, re-run ./bootstrap.sh in thebrana — do not add brana/ruflo to a per-client .mcp.json (that file is only for client-specific servers, e.g. supabase, playwright, respond-io). Note: mcpServers in any settings.local.json is silently ignored by Claude Code.S1: mkdir -p docs/architecture/decisions
S2: Create first ADR pre-populated from DISCOVER answers.
S3: Verify PreToolUse hook is installed (run deploy.sh if needed).
S4-S5: Verify skill availability, document convention.
T1: Detect/initialize test framework from stack. T2: Run tests, verify exit 0. T3: Check tdd-guard availability. T4: Configure coverage baseline.
F1 — Description: Create/merge CLAUDE.md with business context (stage, domain, team, framework).
Content constraints (mirrors code errata #141): Apply claudemd.md Step 2 include/exclude rules. Specifically omit:
docs/ or external sheetsdocs/ or operational toolsdocs/preguntas-{client}.md (or docs/open-questions.md), not CLAUDE.mdGoal: CLAUDE.md should be <60 lines after F1. If it exceeds 80 lines, invoke Skill("brana:claudemd", args="audit .claude/CLAUDE.md") before proceeding to VERIFY.
F2 — Decision log: mkdir -p docs/architecture/decisions. Create ADR-001 for framework selection.
F3 — Metrics: mkdir -p docs/metrics. Create README with stage-appropriate metric tables.
F4 — Cadence: mkdir -p docs/meetings. Create cadence.md with stage-appropriate meeting schedule.
F5 — Inbox: Ensure inbox/ exists and is gitignored (same as code F5).
Create stage-appropriate templates: hypothesis docs, experiment tracking, OKR templates, SOP directory, hiring plan, referrer tracking — based on the assessed stage.
Re-run the checklist. Compare before/after:
ALIGNMENT REPORT
================
Type: {Code | Venture | Hybrid}
Tier/Stage: {Standard | Growth | ...}
Before After
Foundation: ■■□□ ■■■■ 2/4 → 4/4
SDD: □□□□□ ■■■■□ 0/5 → 4/5
────── ──────
Total: 2/9 8/9
Remaining gaps:
S5 — Spec-first convention (builds over time)
source "$HOME/.claude/scripts/cf-env.sh"
[ -n "$CF" ] && cd "$HOME" && $CF memory store \
-k "alignment:{PROJECT}:{date}" \
-v '{"type": "{code|venture}-alignment", "score_before": N, "score_after": N}' \
--namespace alignment \
--tags "client:{PROJECT},type:alignment" \
--upsert
~/.claude/tasks-portfolio.json (machine registry consumed by brana portfolio / cross-project backlog_add). Hand-edit until auto-registration lands (t-2240) — v2 schema: clients[] → {slug, projects[] → {slug, path, type?, stage?, tech_stack?}}. Verify with brana portfolio..claude/alignment-report.md in the projectIf context was compressed and you've lost track of progress:
TaskList — find CC Tasks matching /brana:align — {STEP}in_progress task is your current phase — resume from there.claude/alignment-report.md if VERIFY was already reached