Skip to content

Commit 0ec5697

Browse files
authored
Add Step 12 compile-first iteration guidance to reduce workflow-not-compiled dropoff (#1651)
1 parent 10731bb commit 0ec5697

4 files changed

Lines changed: 103 additions & 1 deletion

File tree

workshop/00-welcome.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ By the end of this workshop, a real AI agent will create an issue with a summary
1010

1111
You'll build an **[Agentic Workflow](https://github.github.com/gh-aw/introduction/overview/)**: a GitHub Action that uses AI to inspect your repository, decide what matters, and publish a useful status report on a schedule — practical enough to adapt for real teams.
1212

13+
Along the way, you'll compile the workflow, trigger test runs, and iterate on the prompt until the output matches your intent.
14+
1315
![Preview of a completed workflow run in the Actions tab](images/00-workflow-run-complete.svg)
1416

1517
<!-- journey: all -->

workshop/09-agentic-editing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ Review the Markdown body of your workflow and remove any sentences that repeat t
131131
- [ ] I re-ran the workflow from **Actions** and confirmed the updated output matches my intent
132132

133133
<!-- journey: all -->
134-
**Next:** [What's Next? Keep Exploring](14-next-steps.md)
134+
**Next:** [Test and Improve Your Workflow](12-test-and-iterate.md)
135135
<!-- /journey -->

workshop/12-test-and-iterate.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!-- page-journey: all -->
2+
<!-- page-adventure: core -->
3+
# Test and Improve Your Workflow
4+
5+
_The fastest path to a better workflow is a tight loop: change one thing, compile, test, and compare the result._
6+
7+
## 🎯 What You'll Do
8+
9+
You'll make one small improvement to your workflow, recompile it before testing, trigger a fresh run, and compare the new output against the previous one.
10+
11+
By the end of this step, you'll have a repeatable iteration loop you can use any time the workflow output is vague, incorrect, or missing something important.
12+
13+
## 📋 Before You Start
14+
15+
- You have a working workflow draft from [Refine Your Workflow with Agentic Editing](09-agentic-editing.md) or an equivalent earlier build step in your chosen path.
16+
- You have at least one completed workflow run to inspect.
17+
- You can edit the workflow in a terminal, Codespace, or Copilot agent session.
18+
19+
## Start With One Concrete Observation
20+
21+
Open the latest run in the **Actions** tab and look for one thing you want to improve.
22+
23+
Good examples:
24+
25+
- The summary is too generic.
26+
- An important detail is missing.
27+
- The tone feels too stiff.
28+
- The formatting is inconsistent.
29+
30+
Pick only one problem for this round. Small, isolated changes make it much easier to tell what actually improved the result.
31+
32+
## Make One Targeted Change
33+
34+
Open your workflow source file, such as `.github/workflows/daily-status.md`, and change only one instruction in the Markdown body or the YAML frontmatter at the top of the file.
35+
36+
Examples of focused changes:
37+
38+
- ask for a shorter or more structured output format
39+
- name one missing field the agent should include
40+
- add a fallback instruction for empty results
41+
- tighten one permission or safe-output rule
42+
43+
If you are using a Copilot agent to edit the file, tell it to make the change, review the diff, and then run `gh aw compile` before testing.
44+
45+
> [!IMPORTANT]
46+
> Compile after every workflow edit before you test it. GitHub Actions runs the compiled `.lock.yml` file, not the source `.md` file, so skipping `gh aw compile` means you are testing stale workflow logic.
47+
48+
## Compile Before You Test
49+
50+
From your repository root, run:
51+
52+
```bash
53+
gh aw compile
54+
```
55+
56+
This updates the compiled lock file that GitHub Actions actually executes.
57+
58+
If the compiler reports an error, fix that first. Do not start a new test run until compilation succeeds.
59+
60+
> [!TIP]
61+
> If you expect to make several small edits in a row, `gh aw compile --watch` can speed up the loop by recompiling after each save.
62+
63+
## Commit Both Workflow Files
64+
65+
After `gh aw compile` succeeds, commit both the source workflow and the regenerated lock file:
66+
67+
```bash
68+
git add .github/workflows/daily-status.md .github/workflows/daily-status.lock.yml
69+
git commit -m "refine daily-status workflow output"
70+
git push
71+
```
72+
73+
If your workflow uses a different filename, stage that `.md` file and its matching `.lock.yml` file instead.
74+
75+
## Trigger a Fresh Run and Compare
76+
77+
Use **workflow_dispatch** from the **Actions** tab to trigger a new run. Then compare the latest result with the previous one.
78+
79+
Ask yourself:
80+
81+
- Did the new run reflect the change you made?
82+
- Is the output more useful than before?
83+
- Did you improve the original problem without creating a new one?
84+
85+
If yes, keep the change. If not, revert the change and try a different adjustment.
86+
87+
If you want a stricter review loop, score each run for accuracy, completeness, and tone before you decide what to change next.
88+
89+
## ✅ Checkpoint
90+
91+
- [ ] I identified one specific problem from a real workflow run
92+
- [ ] I changed only one instruction or configuration detail before testing again
93+
- [ ] I ran `gh aw compile` after the edit and before triggering the next run
94+
- [ ] I committed both the workflow `.md` file and the regenerated `.lock.yml` file
95+
- [ ] I compared the new run with the previous run and decided what to change next
96+
97+
<!-- journey: all -->
98+
**Next:** [What's Next? Keep Exploring](14-next-steps.md)
99+
<!-- /journey -->

workshop/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ A hands-on workshop that takes you from zero to a fully automated, AI-powered wo
2626
| 8 | [08-run-your-workflow.md](08-run-your-workflow.md) | Run and Watch Your Workflow ||
2727
| 8b | [08b-interpret-your-run.md](08b-interpret-your-run.md) | Interpret Your First Run ||
2828
| 9 | [09-agentic-editing.md](09-agentic-editing.md) | Refine Your Workflow with Agentic Editing ||
29+
| 12 | [12-test-and-iterate.md](12-test-and-iterate.md) | Test and Improve Your Workflow ||
2930
| 14 | [14-next-steps.md](14-next-steps.md) | What's Next? Keep Exploring ||
3031
| 15 | [15-conditional-logic.md](15-conditional-logic.md) | Make Your Workflow Smarter with Conditional Logic ||
3132
| 16 | [16-connect-data-source.md](16-connect-data-source.md) | Connect a Live Data Source to Your Workflow ||

0 commit comments

Comments
 (0)