Skip to content

Commit ee2ab42

Browse files
theletterfclaude
andcommitted
Restore fragments with inlined-imports: true
Use the gh-aw inlined-imports frontmatter flag (v0.67.3) to embed all imported content at compile time. This produces self-contained lock files with zero runtime-import directives, fixing the cross-repo workflow_call failure while keeping fragments for reuse. - Add inlined-imports: true to both workflow .md sources - Restore gh-aw-fragments/ with formatting, rigor, mcp-pagination, messages-footer, and safe-output-add-comment - Move shared content back into fragments, out of workflow prompts - Update DEVELOPING.md to document inlined-imports convention - Update create-agentic-workflow skill to use imports + inlined-imports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8a78d3a commit ee2ab42

12 files changed

Lines changed: 471 additions & 219 deletions

File tree

.claude/skills/create-agentic-workflow/SKILL.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ Read an existing workflow for reference:
6565
- `.github/workflows/gh-aw-docs-check.md` — on-demand check pattern
6666
- `.github/workflows/gh-aw-issue-triage.md` — triage pattern with pre-steps
6767

68-
Generate `.github/workflows/gh-aw-<name>.md` with all content inlined. **Do NOT use `imports:`** — the gh-aw runtime import mechanism does not work for cross-repo `workflow_call`, which is how consumer repos invoke these workflows. All prompt content, safe-output constraints, and MCP server docs must be directly in the `.md` file.
68+
Generate `.github/workflows/gh-aw-<name>.md`. Read the available fragments in `.github/workflows/gh-aw-fragments/` and import those relevant to the workflow. **Always include `inlined-imports: true`** — this embeds all imported content at compile time, which is required for cross-repo `workflow_call` invocation.
6969

7070
```yaml
7171
---
7272
description: |
7373
<one-line description>
7474
75+
inlined-imports: true
76+
imports:
77+
- gh-aw-fragments/formatting.md
78+
- gh-aw-fragments/rigor.md
79+
- gh-aw-fragments/mcp-pagination.md
80+
- gh-aw-fragments/messages-footer.md
81+
- gh-aw-fragments/safe-output-<type>.md
7582
engine:
7683
id: copilot
7784
on:
@@ -116,8 +123,6 @@ network:
116123
- "www.elastic.co"
117124
strict: false
118125
safe-outputs:
119-
messages:
120-
footer: "${{ inputs.messages-footer || '---\n[Docs automation](https://github.com/elastic/docs-actions) | [From workflow: {workflow_name}]({run_url})\n\nReact with 👍 if helpful, 👎 if not.' }}"
121126
noop:
122127
<output-type>:
123128
timeout-minutes: 30
@@ -130,22 +135,17 @@ steps:
130135
---
131136
```
132137

133-
Follow the frontmatter with the agent prompt in markdown. Structure it as:
138+
Follow the frontmatter with the agent prompt in markdown. The imported fragments provide formatting guidelines, rigor standards, MCP pagination tips, safe-output limitations, and the message footer note — so you don't need to repeat those. Structure the workflow-specific prompt as:
134139
1. **Role statement** — who the agent is and what it does
135-
2. **Formatting guidelines** — lead with key info, be concise, use `<details>` tags
136-
3. **Rigor** — evidence standards, noop-over-noise philosophy (for audit/check workflows)
137-
4. **MCP pagination** — token limit guidance if the workflow uses MCP tools
138-
5. **Data gathering** — what to read, search, or fetch
139-
6. **Analysis** — what to look for, how to evaluate findings
140-
7. **What to skip** — explicit exclusions to reduce noise
141-
8. **Quality gate** — when to noop vs. when to report (noop is the expected outcome)
142-
9. **Safe output limitations** — max body size, mention limits, allowed HTML for the output type
143-
10. **Message footer note** — "A footer is automatically appended to all comments and reviews. Do not add your own footer or sign-off — the runtime handles this."
144-
11. **Output format** — exact format for the issue body, PR body, or comment
140+
2. **Data gathering** — what to read, search, or fetch
141+
3. **Analysis** — what to look for, how to evaluate findings
142+
4. **What to skip** — explicit exclusions to reduce noise
143+
5. **Quality gate** — when to noop vs. when to report (noop is the expected outcome)
144+
6. **Output format** — exact format for the issue body, PR body, or comment
145145

146146
End with `${{ inputs.additional-instructions }}` so callers can inject repo-specific guidance.
147147

148-
Not every section is needed for every workflow — include what's relevant. Read the existing workflows for examples of what to include.
148+
Read the existing workflows for examples.
149149

150150
### Step 4: Generate the trigger template
151151

.github/aw/actions-lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"version": "v8",
66
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
77
},
8-
"github/gh-aw-actions/setup@v0.67.2": {
8+
"github/gh-aw-actions/setup@v0.67.3": {
99
"repo": "github/gh-aw-actions/setup",
10-
"version": "v0.67.2",
11-
"sha": "03e31e064a68e8d5ad890c92f303cfb5a3536006"
10+
"version": "v0.67.3",
11+
"sha": "eef369c24101e76a5bf51579c26798b28f666813"
1212
}
1313
}
1414
}

.github/workflows/gh-aw-docs-check.lock.yml

Lines changed: 200 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/gh-aw-docs-check.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ description: |
44
Analyzes code changes against the Elastic docs corpus and reports
55
which pages need updates, additions, or review.
66
7+
inlined-imports: true
8+
imports:
9+
- gh-aw-fragments/formatting.md
10+
- gh-aw-fragments/rigor.md
11+
- gh-aw-fragments/mcp-pagination.md
12+
- gh-aw-fragments/messages-footer.md
13+
- gh-aw-fragments/safe-output-add-comment.md
714
engine:
815
id: copilot
916
on:
@@ -56,16 +63,12 @@ network:
5663
- "docs-v3-preview.elastic.dev"
5764
strict: false
5865
safe-outputs:
59-
messages:
60-
footer: "${{ inputs.messages-footer || '---\n[Docs automation](https://github.com/elastic/docs-actions) | [From workflow: {workflow_name}]({run_url})\n\nReact with 👍 if helpful, 👎 if not.' }}"
6166
allowed-domains:
6267
- www.elastic.co
6368
- docs-v3-preview.elastic.dev
6469
- github.com
6570
noop:
6671
add-comment:
67-
max: 1
68-
discussions: false
6972
timeout-minutes: 30
7073
steps:
7174
- name: Repo-specific setup
@@ -160,21 +163,6 @@ Post a single, well-structured comment using `add_comment` with the following fo
160163
<For each affected page, a brief explanation of what needs to change and why.>
161164
```
162165

163-
## add-comment Limitations
164-
165-
- **Body**: Max 65,536 characters (including any footer added by gh-aw). Keep well under this limit.
166-
- **Mentions**: Max 10 `@` mentions per comment.
167-
- **Links**: Max 50 URLs per comment.
168-
- **HTML**: Only safe tags allowed (`details`, `summary`, `code`, `pre`, `blockquote`, `table`, `b`, `em`, `strong`, `h1`-`h6`, `hr`, `br`, `li`, `ol`, `ul`, `p`, `sub`, `sup`). Other tags are converted to parentheses.
169-
- **URLs**: Only HTTPS URLs to allowed domains. Non-HTTPS and non-allowed domains are redacted.
170-
- **Bot triggers**: References like `fixes #123` or `closes #456` are neutralized to prevent unintended issue closures.
171-
172-
If you exceed 10 mentions or 50 links, the comment will be rejected.
173-
174-
## Message Footer
175-
176-
A footer is automatically appended to all comments and reviews. Do not add your own footer or sign-off — the runtime handles this.
177-
178166
## Edge cases
179167

180168
- If the URL is not a valid GitHub PR or commit URL, report the error and suggest the correct format.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Formatting Guidelines
2+
3+
- Lead with the most important information — your first sentence should be the key takeaway
4+
- Be concise and actionable — no filler or praise
5+
- Use `<details>` and `<summary>` tags for long sections to keep responses scannable
6+
- Wrap branch names and @-references in backticks to avoid pinging users
7+
- Include code snippets with file paths and line numbers when referencing the codebase
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## MCP Pagination
2+
3+
MCP tool responses have a **25,000 token limit**. When responses exceed this limit, the call fails and you must retry with pagination — wasting turns and tokens. Use proactive pagination to stay under the limit.
4+
5+
### Recommended `perPage` Values
6+
7+
- **5-10**: For detailed items (PR diffs, files with patches, issues with comments)
8+
- **20-30**: For medium-detail lists (commits, review comments, issue lists)
9+
- **50-100**: For simple list operations (branches, labels, tags)
10+
11+
### Pagination Pattern
12+
13+
When you need all results from a paginated API:
14+
15+
1. Fetch the first page with a conservative `perPage` value
16+
2. Process the results before fetching the next page
17+
3. Continue fetching pages until you receive fewer results than `perPage` (indicating the last page)
18+
19+
If you see `MCP tool response exceeds maximum allowed tokens`, retry with a smaller `perPage` value (halve it).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
safe-outputs:
3+
messages:
4+
footer: "${{ inputs.messages-footer || '---\n[Docs automation](https://github.com/elastic/docs-actions) | [From workflow: {workflow_name}]({run_url})\n\nReact with 👍 if helpful, 👎 if not.' }}"
5+
---
6+
7+
## Message Footer
8+
9+
A footer is automatically appended to all comments and reviews. Do not add your own footer or sign-off — the runtime handles this.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Rigor
2+
3+
**Silence is better than noise. A false positive wastes a human's time and erodes trust in every future report.**
4+
5+
- If you claim something is missing or broken, show the exact evidence in the code — file path, line number, and what you observed.
6+
- If a conclusion depends on assumptions you haven't confirmed, do not assert it. Verify first; if you cannot verify, do not report.
7+
- "I don't know" is better than a wrong answer. `noop` is better than a speculative finding.
8+
- It's worth the time to verify now versus guessing and forcing someone else to verify later.
9+
- Before filing any issue or opening any PR, re-read your own output as a skeptical reviewer. Ask: "Would a senior engineer on this team find this useful, or would they close it immediately?" If the answer is "close," call `noop` instead.
10+
- Only report findings you would confidently defend in a code review. If you feel the need to hedge with "might," "could," or "possibly," the finding is not ready to file.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
safe-outputs:
3+
add-comment:
4+
max: 1
5+
discussions: false
6+
---
7+
8+
## add-comment Limitations
9+
10+
- **Body**: Max 65,536 characters (including any footer added by gh-aw). Keep well under this limit.
11+
- **Mentions**: Max 10 `@` mentions per comment.
12+
- **Links**: Max 50 URLs per comment.
13+
- **HTML**: Only safe tags allowed (`details`, `summary`, `code`, `pre`, `blockquote`, `table`, `b`, `em`, `strong`, `h1`-`h6`, `hr`, `br`, `li`, `ol`, `ul`, `p`, `sub`, `sup`). Other tags are converted to parentheses.
14+
- **URLs**: Only HTTPS URLs to allowed domains. Non-HTTPS and non-allowed domains are redacted.
15+
- **Bot triggers**: References like `fixes #123` or `closes #456` are neutralized to prevent unintended issue closures.
16+
17+
If you exceed 10 mentions or 50 links, the comment will be rejected.

0 commit comments

Comments
 (0)