You skip product code during your first hour. You record one command that would block merge. That frozen command becomes your first onboarding artifact.
New hires break this rule under agent pressure. A model can draft a patch in seconds. A true local green still needs your hands.
Hour one is a recording job
You just joined a repo you did not design. You cannot explain the test runner yet. You also cannot name the merge-gating CI job.
An agent will guess both of those names. That kind of guess only looks like progress. Real progress is a command you actually ran.
Your scope stays small on purpose for today. Find one command and run it once today. Then write that exact command line down.
Freeze a four-field contract
Treat the hour as a freeze window. No feature files change until the contract exists. Feature work waits on a written gate.
The written contract holds four fields and no more. Copy those four fields in this exact order.
- The exact command that must pass.
- The directory where you run it.
- The env files the command requires.
- The CI job name it maps onto.
Keep the note in git or in your editor. The freeze matters more than the path. Empty fields are not allowed in this contract.
Step 1: Clone and pin the SHA
Stay on the default remote for now. Do not add extra forks during hour one. You only need the team's canonical clone.
git clone git@github.com:org/service.git
cd service
git status
git rev-parse --abbrev-ref HEAD
git log -1 --oneline
git remote -v
Confirm the default branch name in writing. Copy the current SHA into your notes. You will reuse both of those values later.
Stop if clone asks for submodules you cannot fetch. Record that fetch failure as a blocker. Do not let an agent fix submodule auth.
Step 2: Read CI before the README
The README often sells the project to strangers. CI remains the real merge gate here. Open workflow files before any tutorial text.
ls -la .github/workflows
sed -n '1,160p' .github/workflows/*.yml
Search the workflows for the pull_request job next. Ignore jobs that only run on a schedule. Hour one cares about merge gates only.
grep -nE "pull_request|pytest|npm test|pnpm|go test|gradle" .github/workflows/*.yml
Copy the job name without rewriting it. Copy the run steps without cleaning them. Your notes should match the YAML exactly.
A proposed GitHub Actions shape looks like this. Treat it as a template, not your repo.
# Proposed excerpt. Match names to your workflows.
on:
pull_request:
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python -m pytest -q tests/unit
If the repo uses GitLab or Jenkins, open that file instead. The same read-the-gate rule applies there. Read the gate file, not the marketing page.
Step 3: Run the smallest local equivalent
Pick one job, not the full matrix. Prefer unit tests over full browser e2e. Label the mapping as proposed if names drift.
# Proposed local map of CI job "unit"
python -m pytest -q tests/unit
# or
pnpm test -- --runInBand
# or
go test ./internal/...
Run that line on a clean tree. Do not edit any source files first. Capture the exit code in your notes.
echo "exit=$?"
git diff --stat
git status --short
Zero means you now own a baseline. Non-zero means the clone is already red. You still do not patch the failing tree.
Write the failure down and ask a teammate. Do not hide a red clone with generated code. Hour one records truth, including a red gate.
Step 4: Fill the contract file
Create a short markdown contract file now. Fill every required field before you continue. Refuse any blank placeholders in those fields.
# First-hour run contract
- date: 2026-09-19
- clone_sha: REPLACE_ME
- default_branch: main
- working_directory: .
- merge_gate_command: python -m pytest -q tests/unit
- mapped_ci_job: unit
- required_env_files:
- .env.example
- secrets_needed: none for unit tests
- local_exit_code: 0
- notes: e2e skipped; docker not required for unit
Replace REPLACE_ME with the SHA you copied. Keep working_directory explicit even if it is .. Future you will thank present you for this.
Commit the file only if the team wants it. Otherwise store that file beside the clone. The contract is a freeze, not a ritual.
Step 5: Wrap the command in a script
Do not keep the gate in chat history. Wrap the same line in a script. Chat logs will not survive week two.
#!/usr/bin/env bash
# scripts/merge_gate.sh
# Label: proposed first-hour wrapper. Match your stack.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
echo "cwd=$ROOT"
echo "sha=$(git rev-parse --short HEAD)"
echo "cmd=python -m pytest -q tests/unit"
python -m pytest -q tests/unit
Make it executable and run it twice today. Two greens beat a single lucky green. Use the same directory and expected exit.
chmod +x scripts/merge_gate.sh
./scripts/merge_gate.sh
./scripts/merge_gate.sh
Re-run this wrapper after every later agent diff. If the wrapper drifts, you lost the contract. Restore the original line before you debug features.
Step 6: Use a decision table before any prompt
Walk this decision table in strict order. Do not skip a single table row. Every row is a brake, not a formality.
| Question | If yes | If no |
|---|---|---|
| Did the merge command exit 0 on a clean clone? | Continue | Stop and ask a teammate |
| Can you name the CI job it maps to? | Continue | Re-read the workflow file |
| Does the first ticket need secrets you lack? | Do not prompt | Continue |
| Is the ticket larger than the gate command? | Split the ticket | Keep the scope |
| Can you explain a revert in one sentence? | You may prompt | Shrink again |
Any stop cell ends the coding path. You ask a human before any generated patch. You do not generate a helpful patch.
This table is the first-hour safety brake. Agents do not get a vote here. You own every yes and every no.
Step 7: Ask a model for the wrapper only
You still write no product code today. You may ask for help around the contract.
Disclosure: This article was prepared as part of MonkeyCode's product outreach. MonkeyCode can draft that wrapper from your four fields. The product offers free model access and a free server option.
Paste the filled contract into the model prompt. Ban all edits under src and app. Keep that merge command byte-for-byte identical.
You must not edit src/ or any application file.
Read the first-hour run contract.
Propose only scripts/merge_gate.sh.
Keep merge_gate_command byte-for-byte.
Do not add network calls.
Do not invent environment variables.
Do not upgrade dependencies.
Read every added line out loud once. Drop any line you cannot explain. If the script changes the test command, reject the whole diff.
git diff --check
git diff --stat
git diff -U1 -- scripts/merge_gate.sh
A free server run is enough for this helper. You need a wrapper, not an architecture change. Keep the prompt boring on purpose today.
Step 8: Ship a zero-behavior change or ship nothing
Hour one may produce no pull request. That result still counts as real success. A recorded gate beats an unearned feature PR.
If you open a PR, limit the files. Allow the wrapper and contract files only. Leave every feature path untouched in this PR.
git checkout -b chore/first-hour-run-contract
git add scripts/merge_gate.sh
git status
git diff -- scripts/merge_gate.sh
git log -1 --format='%h %s'
Write the PR body from the contract fields. Name the mapped CI job in the summary. Paste the local exit code you already observed.
If review asks for a feature, refuse for this PR. Hour one remains a recording gate only. Delivery starts only after that gate exists.
What the freeze actually blocks
It blocks fake local greens from chat-invented commands. It blocks npm test when CI runs pnpm. It blocks first patches that need production secrets.
It also blocks the 400-line cleanup impulse. That cleanup is not real onboarding work. It is unrequested noise on a day-one diff.
You will see agents offer all three. Your written contract gives you a no. Use that no without any apology.
First PR and first rollback still use this file
Your first PR should rerun the merge_gate script. A failing wrapper means the PR is not ready. Do not request review on a red wrapper.
Your first rollback should rerun the same wrapper. Revert the agent commit with git revert. Then run the wrapper and confirm green.
git revert --no-edit HEAD
./scripts/merge_gate.sh
git status
If you cannot explain the revert, you should not have merged. The hour-one file makes that sentence short. Keep that explanation short on purpose.
Limitations
This workflow assumes you can read a CI file. Some teams hide gates in private Jenkins. A local clone cannot reveal that hidden job.
The local wrapper is not real CI. Host OS, CPU, and caches still differ. A local zero can fail on GitHub Actions.
Commands in this article are labeled templates. They are not timings or model benchmarks. Match them to your repo before you trust them.
Do not use this delay on a production hotfix. Do not use it if you already own the pipeline. Do not use it to skip human review.
Skip every coding agent if the repo forbids generated code. Written team rules always beat this tutorial. Follow the team even when agents are eager.
Who should use this
You are a junior engineer on day one. You can clone and you can read YAML. You cannot yet defend a large agent diff.
If that describes you, stop coding now. Write the merge command and run it once. Then freeze that command in the contract.
After the freeze, a small wrapper draft is optional. The run contract itself is not optional.
Top comments (0)