seed: curriculum content
This commit is contained in:
63
1.solar-system/1.welcome/17.team-build/index.md
Normal file
63
1.solar-system/1.welcome/17.team-build/index.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
type: battle
|
||||
title: "Team Build"
|
||||
xp: 200
|
||||
duration: 90
|
||||
difficulty: 3
|
||||
---
|
||||
|
||||
# Team Build
|
||||
|
||||
> **[INCOMING — Mission Control, Earth]**
|
||||
>
|
||||
> Cadets, this is your final task before Python. You and a partner will
|
||||
> automate a mission setup together — one writing, the other
|
||||
> reviewing. Then swap.
|
||||
>
|
||||
> Pair up. Decide who goes first as **defender** and who goes first as
|
||||
> **attacker**.
|
||||
>
|
||||
> [END TRANSMISSION]
|
||||
|
||||
## The Task
|
||||
|
||||
The **defender** writes a single shell script — `launch.sh` — that,
|
||||
when run inside an empty workspace, does the following in order:
|
||||
|
||||
1. Creates a folder called `mission/` and enters it.
|
||||
2. Initializes a fresh Git repo on branch `main`.
|
||||
3. Sets `user.name` and `user.email` on the repo (use your own).
|
||||
4. Creates `manifest.txt` containing exactly:
|
||||
```
|
||||
Mission Apollo
|
||||
```
|
||||
5. Creates `crew.txt` containing exactly:
|
||||
```
|
||||
Cadet A, Cadet B
|
||||
```
|
||||
6. Creates `coords.txt` containing exactly:
|
||||
```
|
||||
lat: 0.0, lon: 0.0
|
||||
```
|
||||
7. Commits each file separately, in this exact order, with messages:
|
||||
- `add manifest`
|
||||
- `add crew`
|
||||
- `add coords`
|
||||
8. Prints `MISSION READY` to stdout when done.
|
||||
|
||||
## Battle Rules
|
||||
|
||||
- **Defender**: writes `launch.sh` from scratch in a clean workspace.
|
||||
Does not show the file until done. Time limit: 30 minutes.
|
||||
- **Attacker**: receives the script, runs it in a clean folder,
|
||||
inspects the resulting `mission/`, and submits a review through the
|
||||
platform's review form.
|
||||
- **Then swap**: roles flip. The new defender writes their own
|
||||
`launch.sh` (no copy-pasting). 30 more minutes.
|
||||
- Both pass the battle if both scripts pass review.
|
||||
|
||||
## Tools You'll Use
|
||||
|
||||
Everything you've learned this module:
|
||||
`mkdir`, `cd`, `echo`, `>`, `git init`, `git config`, `git add`,
|
||||
`git commit`, and a shebang to make the script run.
|
||||
70
1.solar-system/1.welcome/17.team-build/review/general.md
Normal file
70
1.solar-system/1.welcome/17.team-build/review/general.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Team Build — Extended Notes
|
||||
|
||||
*Not rendered in the platform yet. Reference for instructors and for
|
||||
future "learn more" surfaces.*
|
||||
|
||||
## Purpose
|
||||
|
||||
The capstone of `1.welcome`. By this point a cadet has used every
|
||||
tool they need: `mkdir`, `echo`, `git init`, `git config`, `git add`,
|
||||
`git commit`, and shell scripting with `chmod +x`. This battle forces
|
||||
them to combine all of it into a single artifact — a working
|
||||
automation script — and to read someone else's script for the first
|
||||
time.
|
||||
|
||||
## Skills Demonstrated
|
||||
|
||||
- Composing learned commands into a sequential program
|
||||
- Writing a script with a correct shebang and execute bit
|
||||
- Producing exact output from automation
|
||||
- Reading another cadet's code well enough to score it
|
||||
- Giving and receiving honest feedback under a time limit
|
||||
|
||||
## Common Pitfalls
|
||||
|
||||
- **One commit covering all three files** — defenders forget that the
|
||||
spec says *each file commits separately*. Three commits, not one.
|
||||
- **File contents with extra whitespace** — `echo` adds a trailing
|
||||
newline by default, which is fine; trailing spaces on the line are
|
||||
not. Reviewers should `cat -A` to spot invisible characters.
|
||||
- **Missing or wrong identity** — `git commit` will succeed even
|
||||
without `user.name` set if a fallback is configured globally;
|
||||
reviewers should check `git -C mission config user.name` directly.
|
||||
- **Hardcoded absolute paths** — `cd /Users/...` breaks the moment
|
||||
the script runs on someone else's machine. Use relative paths.
|
||||
- **`MISSION READY` printed inside another message** — the spec says
|
||||
"exactly". `echo "Done. MISSION READY now."` should fail review.
|
||||
- **Forgetting `chmod +x`** — script runs fine via `bash launch.sh`
|
||||
but fails when executed directly. Reviewers should test both.
|
||||
|
||||
## Discussion Prompts (post-battle)
|
||||
|
||||
Ask the pair to discuss for 5 minutes after both rounds:
|
||||
|
||||
1. Whose script was easier to read? Why?
|
||||
2. Was anything in the spec ambiguous? How would you tighten it?
|
||||
3. What would you do differently if you wrote this from scratch
|
||||
today?
|
||||
4. Did you find a bug your partner missed?
|
||||
|
||||
## Alternative Approaches
|
||||
|
||||
A cadet who's seen heredocs might write:
|
||||
|
||||
```bash
|
||||
cat > manifest.txt <<EOF
|
||||
Mission Apollo
|
||||
EOF
|
||||
```
|
||||
|
||||
Both `echo "..." > file` and heredoc are acceptable. The spec
|
||||
doesn't require a specific style — only that the resulting file
|
||||
content match exactly.
|
||||
|
||||
## Why This Is the Last Block of Welcome
|
||||
|
||||
This is the bridge between mechanical skill (typing commands) and
|
||||
real engineering (composing them, reading others' code, judging
|
||||
quality). Cadets who pass this battle have proven they can act as
|
||||
both author and reviewer — the foundational loop of every
|
||||
collaborative codebase. Python is built on this foundation.
|
||||
38
1.solar-system/1.welcome/17.team-build/review/review.json
Normal file
38
1.solar-system/1.welcome/17.team-build/review/review.json
Normal file
@@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
"title": "Script Quality",
|
||||
"icon": "ph:code-duotone",
|
||||
"items": [
|
||||
"Script starts with #!/bin/bash shebang",
|
||||
"Script is executable (chmod +x applied)",
|
||||
"Script runs without errors",
|
||||
"Prints exactly 'MISSION READY' at the end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Repo State",
|
||||
"icon": "ph:git-branch-duotone",
|
||||
"items": [
|
||||
"mission/.git/ exists after running the script",
|
||||
"user.name is set on the mission repo",
|
||||
"user.email is set and looks like an email"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Files",
|
||||
"icon": "ph:files-duotone",
|
||||
"items": [
|
||||
"manifest.txt contains exactly 'Mission Apollo'",
|
||||
"crew.txt contains exactly 'Cadet A, Cadet B'",
|
||||
"coords.txt contains exactly 'lat: 0.0, lon: 0.0'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Commits",
|
||||
"icon": "ph:list-duotone",
|
||||
"items": [
|
||||
"Three separate commits exist (not one combined commit)",
|
||||
"Commit messages, in order: 'add manifest', 'add crew', 'add coords'"
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user