这是一篇由原始材料转换而来的阅读页,保留了源文件的主要结构,并补充了可追溯的来源说明与链接。

摘要

echo "[init] repo: $(pwd)"

openaireference filetemplate / pattern
#!/usr/bin/env bash
set -euo pipefail

# OpenAI-style init.sh
# Purpose:
# 1) confirm repo health
# 2) install/check prerequisites when safe
# 3) start or verify the local environment
# 4) run a smoke test
# 5) expose failures early so each session starts from a known baseline

echo "[init] repo: $(pwd)"

if ! command -v git >/dev/null 2>&1; then
  echo "[init] ERROR: git not found" >&2
  exit 1
fi

if [ ! -d .git ]; then
  echo "[init] ERROR: run from repository root (.git missing)" >&2
  exit 1
fi

git status --porcelain=v1

# --- Customize for your stack ---
# Good OpenAI-style additions:
# - verify required tools exist
# - start the app in an isolated worktree or temp env if appropriate
# - run a smoke test that catches obvious regressions
# - optionally start local observability helpers for logs/metrics/traces
#
# Example ideas:
# - npm ci && npm test && npm run dev &
# - uv sync && pytest -q && uv run app &
# - docker compose up -d && curl health endpoint
#
# The important thing is not sophistication; it is reliability.

echo "[init] TODO: customize install/start/smoke-test for this repository"
echo "[init] OK (template baseline only)"

来源与参考

源文件: openai/templates/init.sh

来源目录: /srv/project/harness-engineering

继续阅读