返回 CodeWhale
SKILL.md
1 ---
2 name: contributor-onboarding
3 description: Help a new contributor get productive on this checkout - inspect sync state against main, build, run the repository's exact verification gate, and produce a local what's-new digest. Never fetches, pulls, or modifies a dirty tree on its own. Explicit-only.
4 invocation: explicit-only
5 ---
6
7 # Contributor Onboarding
8
9 A first-run path for a contributor who has cloned the repo and wants to know
10 *am I current, does it build, does it pass, and what changed while I was
11 away* — without a wall of prose and without anything touching their working
12 tree behind their back.
13
14 ## Invocation
15
16 Explicit-only. Loading this skill is **not** authority to fetch, pull, rebase,
17 push, or write files. Every network or mutating step below is a separate action
18 the contributor must ask for after reading the plan.
19
20 ## Non-goals
21
22 - Do not run `git fetch`, `git pull`, `git rebase`, or `git checkout` on your
23 own initiative. Report state; propose the command; wait.
24 - Do not stash, discard, reset, or commit a dirty tree. Ever.
25 - Do not call a model provider. Every step here is a local command with a
26 deterministic result. The digest is built from files and git output, not
27 generated prose.
28 - Do not claim a gate passed that you did not run, and do not summarize a
29 build you did not observe.
30 - Do not privilege any provider. Codewhale is provider-neutral; a dogfood run
31 uses whatever route the contributor already configured, or none.
32
33 ## Workflow
34
35 ### 1. Inspect (read-only, always safe)
36
37 Run these and report the results verbatim. Nothing here writes:
38
39 ```
40 git rev-parse --abbrev-ref HEAD
41 git status --porcelain
42 git rev-list --left-right --count origin/main...HEAD
43 ```
44
45 Report three facts plainly:
46
47 - **Branch** the contributor is on.
48 - **Tree state**: clean, or the count and paths of dirty entries.
49 - **Sync state**: `N behind, M ahead` of `origin/main`, or **unavailable** when
50 `origin/main` is missing or has never been fetched. Unavailable is a real
51 answer — say it rather than guessing zero.
52
53 ### 2. Sync — propose, never perform
54
55 If behind, print the exact commands and stop:
56
57 ```
58 git fetch origin
59 git rebase origin/main # or: git merge origin/main
60 ```
61
62 **If the tree is dirty, do not propose a sync at all.** Print a recovery plan
63 first, in this order, and let the contributor choose:
64
65 1. `git stash push -u -m "wip before sync"` then sync, then `git stash pop`
66 2. Commit the work on a branch, then sync
67 3. Stay behind and continue — being behind is not an error
68
69 ### 3. Build
70
71 ```
72 cargo build --release -p codewhale-cli --bin codewhale
73 ```
74
75 Report the exit status and the first error if it fails. A build failure ends
76 the run: do not proceed to the gate and do not report gate results.
77
78 ### 4. Verification gate — the repository's exact CI command
79
80 Run what CI runs, not a paraphrase of it. Read `.github/workflows/ci.yml`
81 first and run its Rust steps verbatim; the list below is a snapshot that
82 loses to the workflow when they disagree:
83
84 ```
85 cargo fmt --all -- --check
86 cargo clippy --workspace --all-targets --all-features --locked -- \
87 -D warnings \
88 -A clippy::uninlined_format_args \
89 -A clippy::too_many_arguments \
90 -A clippy::unnecessary_map_or
91 cargo test --workspace
92 ```
93
94 If the workflow uses flags this snapshot lacks (or vice versa), say so and
95 follow the workflow.
96
97 Known suite papercut: `run_verifiers_background_*` is flaky under full-suite
98 parallelism and passes in isolation. Attribute it to the known flake, not to
99 the contributor's change.
100
101 ### 5. What's new — deterministic local digest
102
103 Built only from files already on disk. No network, no model:
104
105 ```
106 git log --oneline -n 20 origin/main
107 ```
108
109 plus the topmost released section of `CHANGELOG.md`.
110
111 Rules:
112
113 - Cap the digest at **20 commits and 40 lines** of changelog. State the cap
114 when you hit it; do not silently truncate.
115 - If `origin/main` is unavailable, digest `HEAD` instead and label it as such.
116 - Quote what the files say. Do not summarize, rank, or editorialize — the
117 point is that two contributors on the same commit get the same digest.
118
119 ### 6. Dogfood — optional, staged, confirmed
120
121 Only after the gate has actually passed, and only if the contributor asks.
122 Print the plan and require an explicit yes before running anything:
123
124 ```
125 ./target/release/codewhale exec --help
126 ```
127
128 This is a provider-free smoke check: it exercises the built binary without
129 sending a request anywhere. Anything beyond it — an actual `codewhale exec`
130 turn — needs the contributor's own configured route and their explicit
131 go-ahead. Never select a provider for them and never fall back to a default
132 one.
133
134 ## Reporting
135
136 End with a compact status table: branch, tree, sync, build, gate, digest,
137 dogfood. Use `not run` for anything skipped and `unavailable` for anything the
138 environment could not determine. Never write `passed` from inference.
139
140 ## Credit
141
142 Requested by @JayBeest (#4227). Preserve that attribution in the changelog
143 entry and in the commit body of any change that lands from this skill.
144
144 lines MARKDOWN