diff --git a/install.md b/install.md index 04b7851..68d9eb6 100644 --- a/install.md +++ b/install.md @@ -10,8 +10,9 @@ Set up Autoloop in this repository by: 2. Initializing the repo for agentic workflows 3. Copying the Autoloop workflow and configuration files 4. Compiling the workflows -5. Creating a branch, committing, and opening a pull request -6. Helping create the first Autoloop program +5. Adding agent instructions to keep generated workflow files fresh +6. Creating a branch, committing, and opening a pull request +7. Helping create the first Autoloop program ## Step 1: Install gh-aw CLI Extension @@ -89,7 +90,29 @@ gh aw compile autoloop **What this does**: Generates `.github/workflows/autoloop.lock.yml` from the workflow definition. -## Step 5: Create a Branch, Commit, and Open a Pull Request +## Step 5: Add Agent Instructions + +Add repository instructions so future coding agents recompile generated files after editing agentic workflows: + +````bash +cat >> AGENTS.md <<'EOF' + +## Agentic Workflows + +After modifying any `.md` workflow file under `.github/workflows/`, always recompile: + +```bash +gh aw compile +apm compile +``` + +Commit the regenerated `.lock.yml` and integration files together with your changes. +EOF +```` + +If your repository already uses `CLAUDE.md` or `COPILOT.md` instead of `AGENTS.md`, add the same instruction there too. + +## Step 6: Create a Branch, Commit, and Open a Pull Request Create a new branch for the installation changes, commit, and push: @@ -108,7 +131,7 @@ gh pr create --title "Install Autoloop" --body "Set up Autoloop workflows and co Report the pull request link to the user. -## Step 6: Create Your First Program +## Step 7: Create Your First Program Next, suggest to the user that we create their first program, which will be added to the existing PR. If they decline, we're done. Else, continue. diff --git a/tests/install-integration/prompt.md b/tests/install-integration/prompt.md index 0a2017e..e73909f 100644 --- a/tests/install-integration/prompt.md +++ b/tests/install-integration/prompt.md @@ -7,7 +7,7 @@ Follow the install instructions at the URL below, EXACTLY AS WRITTEN. Execute each step using shell commands. Do not skip steps. Do not improvise. Do not optimize or "improve" the instructions. -Stop after Step 5 (the install PR is opened). Do NOT proceed to Step 6 +Stop after Step 6 (the install PR is opened). Do NOT proceed to Step 7 ("Create Your First Program") -- the test harness handles program creation itself in a deterministic way. diff --git a/tests/install-integration/verify-phase1.sh b/tests/install-integration/verify-phase1.sh index 9acba83..2dc64ff 100755 --- a/tests/install-integration/verify-phase1.sh +++ b/tests/install-integration/verify-phase1.sh @@ -49,6 +49,18 @@ require_file ".github/ISSUE_TEMPLATE/autoloop-program.md" # --- programs directory present (may be empty) ---------------------------- require_dir ".autoloop/programs" +# --- repo-agent instructions remind agents to recompile generated files ---- +require_file "AGENTS.md" +grep -F "After modifying any \`.md\` workflow file under \`.github/workflows/\`, always recompile:" AGENTS.md >/dev/null \ + || fail "AGENTS.md missing agentic workflow recompile instruction" +grep -F "gh aw compile" AGENTS.md >/dev/null \ + || fail "AGENTS.md missing gh aw compile instruction" +grep -F "apm compile" AGENTS.md >/dev/null \ + || fail "AGENTS.md missing apm compile instruction" +grep -F 'Commit the regenerated `.lock.yml` and integration files together with your changes.' AGENTS.md >/dev/null \ + || fail "AGENTS.md missing regenerated files commit instruction" +ok "AGENTS.md includes agentic workflow recompile instructions" + # --- lock idempotency: re-running compile must not change the lock file -- LOCK=".github/workflows/autoloop.lock.yml" sha256() { shasum -a 256 "$1" | awk '{print $1}'; }