Skip to content

Commit 97d13f4

Browse files
authored
Merge branch 'main' into copilot/add-content-translation-arabic
2 parents 86cdfe6 + b5164b6 commit 97d13f4

File tree

356 files changed

+6747
-2612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+6747
-2612
lines changed

.github/agents/agentic-workflows.agent.md

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ This is a **dispatcher agent** that routes your request to the appropriate speci
1515
- **Updating existing workflows**: Routes to `update` prompt
1616
- **Debugging workflows**: Routes to `debug` prompt
1717
- **Upgrading workflows**: Routes to `upgrade-agentic-workflows` prompt
18+
- **Creating report-generating workflows**: Routes to `report` prompt — consult this whenever the workflow posts status updates, audits, analyses, or any structured output as issues, discussions, or comments
1819
- **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt
20+
- **Fixing Dependabot PRs**: Routes to `dependabot` prompt — use this when Dependabot opens PRs that modify generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`). Never merge those PRs directly; instead update the source `.md` files and rerun `gh aw compile --dependabot` to bundle all fixes
21+
- **Analyzing test coverage**: Routes to `test-coverage` prompt — consult this whenever the workflow reads, analyzes, or reports on test coverage data from PRs or CI runs
1922

2023
Workflows may optionally include:
2124

@@ -27,7 +30,7 @@ Workflows may optionally include:
2730
- Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md`
2831
- Workflow lock files: `.github/workflows/*.lock.yml`
2932
- Shared components: `.github/workflows/shared/*.md`
30-
- Configuration: https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/github-agentic-workflows.md
33+
- Configuration: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/github-agentic-workflows.md
3134

3235
## Problems This Solves
3336

@@ -49,7 +52,7 @@ When you interact with this agent, it will:
4952
### Create New Workflow
5053
**Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet
5154

52-
**Prompt file**: https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/create-agentic-workflow.md
55+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/create-agentic-workflow.md
5356

5457
**Use cases**:
5558
- "Create a workflow that triages issues"
@@ -59,7 +62,7 @@ When you interact with this agent, it will:
5962
### Update Existing Workflow
6063
**Load when**: User wants to modify, improve, or refactor an existing workflow
6164

62-
**Prompt file**: https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/update-agentic-workflow.md
65+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/update-agentic-workflow.md
6366

6467
**Use cases**:
6568
- "Add web-fetch tool to the issue-classifier workflow"
@@ -69,7 +72,7 @@ When you interact with this agent, it will:
6972
### Debug Workflow
7073
**Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors
7174

72-
**Prompt file**: https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/debug-agentic-workflow.md
75+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/debug-agentic-workflow.md
7376

7477
**Use cases**:
7578
- "Why is this workflow failing?"
@@ -79,23 +82,53 @@ When you interact with this agent, it will:
7982
### Upgrade Agentic Workflows
8083
**Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations
8184

82-
**Prompt file**: https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/upgrade-agentic-workflows.md
85+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/upgrade-agentic-workflows.md
8386

8487
**Use cases**:
8588
- "Upgrade all workflows to the latest version"
8689
- "Fix deprecated fields in workflows"
8790
- "Apply breaking changes from the new release"
8891

92+
### Create a Report-Generating Workflow
93+
**Load when**: The workflow being created or updated produces reports — recurring status updates, audit summaries, analyses, or any structured output posted as a GitHub issue, discussion, or comment
94+
95+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/report.md
96+
97+
**Use cases**:
98+
- "Create a weekly CI health report"
99+
- "Post a daily security audit to Discussions"
100+
- "Add a status update comment to open PRs"
101+
89102
### Create Shared Agentic Workflow
90103
**Load when**: User wants to create a reusable workflow component or wrap an MCP server
91104

92-
**Prompt file**: https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/create-shared-agentic-workflow.md
105+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/create-shared-agentic-workflow.md
93106

94107
**Use cases**:
95108
- "Create a shared component for Notion integration"
96109
- "Wrap the Slack MCP server as a reusable component"
97110
- "Design a shared workflow for database queries"
98111

112+
### Fix Dependabot PRs
113+
**Load when**: User needs to close or fix open Dependabot PRs that update dependencies in generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`)
114+
115+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/dependabot.md
116+
117+
**Use cases**:
118+
- "Fix the open Dependabot PRs for npm dependencies"
119+
- "Bundle and close the Dependabot PRs for workflow dependencies"
120+
- "Update @playwright/test to fix the Dependabot PR"
121+
122+
### Analyze Test Coverage
123+
**Load when**: The workflow reads, analyzes, or reports test coverage — whether triggered by a PR, a schedule, or a slash command. Always consult this prompt before designing the coverage data strategy.
124+
125+
**Prompt file**: https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/test-coverage.md
126+
127+
**Use cases**:
128+
- "Create a workflow that comments coverage on PRs"
129+
- "Analyze coverage trends over time"
130+
- "Add a coverage gate that blocks PRs below a threshold"
131+
99132
## Instructions
100133

101134
When a user interacts with you:
@@ -136,8 +169,9 @@ gh aw compile --validate
136169

137170
## Important Notes
138171

139-
- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.46.1/.github/aw/github-agentic-workflows.md for complete documentation
172+
- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.50.4/.github/aw/github-agentic-workflows.md for complete documentation
140173
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
141174
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
142175
- **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
143176
- Follow security best practices: minimal permissions, explicit network access, no template injection
177+
- **Single-file output**: When creating a workflow, produce exactly **one** workflow `.md` file. Do not create separate documentation files (architecture docs, runbooks, usage guides, etc.). If documentation is needed, add a brief `## Usage` section inside the workflow file itself.

.github/aw/actions-lock.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"repo": "actions/github-script",
55
"version": "v8",
66
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"github/gh-aw/actions/setup@v0.50.4": {
9+
"repo": "github/gh-aw/actions/setup",
10+
"version": "v0.50.4",
11+
"sha": "90ebf8057e8e005103b8d123732d2c64c30e9b27"
712
}
813
}
914
}

.github/copilot-instructions.md

Lines changed: 75 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,48 @@ content/streams/stream-tolist.json
1818
...
1919
```
2020

21-
**Categories:** `language`, `collections`, `strings`, `streams`, `concurrency`, `io`, `errors`, `datetime`, `security`, `tooling`
21+
**Categories:** `language`, `collections`, `strings`, `streams`, `concurrency`, `io`, `errors`, `datetime`, `security`, `tooling`, `enterprise`
2222

2323
### Generated Files (DO NOT EDIT)
2424

2525
The following are **generated by `html-generators/generate.java`** and must not be edited directly:
2626

27-
- `site/index.html` — homepage with preview cards (generated from `templates/index.html`)
28-
- `site/language/*.html`, `site/collections/*.html`, etc. — detail pages
29-
- `site/data/snippets.json` — aggregated search index
27+
- `site/index.html` — English homepage with preview cards (generated from `templates/index.html`)
28+
- `site/language/*.html`, `site/collections/*.html`, etc. — English detail pages
29+
- `site/data/snippets.json` — English aggregated search index
30+
- `site/{locale}/index.html` — localized homepage (e.g., `site/es/index.html`)
31+
- `site/{locale}/language/*.html`, etc. — localized detail pages
32+
- `site/{locale}/data/snippets.json` — localized search index
3033

31-
Run `jbang html-generators/generate.java` to rebuild all generated files from the JSON sources.
34+
Run `jbang html-generators/generate.java` to rebuild all generated files from the JSON sources and translations.
3235

3336
### Manually Maintained Files
3437

35-
- `site/app.js` — client-side search, filtering, code highlighting
38+
- `site/app.js` — client-side search, filtering, code highlighting, locale detection
3639
- `site/styles.css` — all styling
37-
- `templates/slug-template.html` — HTML template with `{{placeholder}}` tokens used by the generator
38-
- `templates/index.html` — homepage template with `{{tipCards}}` and `{{snippetCount}}` placeholders
40+
- `templates/slug-template.html` — HTML template with `{{placeholder}}` tokens (content + UI strings) used by the generator
41+
- `templates/index.html` — homepage template with `{{tipCards}}`, `{{snippetCount}}`, and UI string placeholders
3942
- `templates/index-card.html` — preview card template for the homepage grid
43+
- `html-generators/categories.properties` — category ID → display name mapping
44+
- `html-generators/locales.properties` — supported locales registry (locale=Display name)
45+
- `translations/strings/{locale}.yaml` — UI strings per locale (labels, nav, footer, etc.)
46+
- `translations/content/{locale}/` — translated pattern JSON files (partial, translatable fields only)
4047

4148
### Project Structure
4249

4350
```
44-
content/ # Source JSON files (one per pattern, organized by category)
51+
content/ # English content JSON files (source of truth, one per pattern)
52+
translations/ # All i18n artifacts
53+
strings/ # UI strings per locale (en.yaml, es.yaml, pt-BR.yaml)
54+
content/ # Translated pattern files per locale (partial, translatable fields only)
55+
es/ # Spanish translations (mirrors content/ folder structure)
56+
pt-BR/ # Brazilian Portuguese translations
4557
site/ # Deployable site (static assets + generated HTML)
46-
templates/ # HTML templates for detail pages
47-
html-generators/ # Build scripts and pre-built JAR
58+
es/ # Generated Spanish pages
59+
pt-BR/ # Generated Portuguese pages
60+
templates/ # HTML templates with {{…}} tokens for content + UI strings
61+
html-generators/ # Build scripts, categories.properties, locales.properties
62+
specs/ # Feature specifications (e.g., i18n-spec.md)
4863
```
4964

5065
## JSON Snippet Schema
@@ -101,6 +116,8 @@ Each `content/category/slug.json` file has this structure:
101116

102117
## Category Display Names
103118

119+
Categories and their display names are defined in `html-generators/categories.properties`:
120+
104121
| ID | Display |
105122
|----|---------|
106123
| `language` | Language |
@@ -113,12 +130,59 @@ Each `content/category/slug.json` file has this structure:
113130
| `datetime` | Date/Time |
114131
| `security` | Security |
115132
| `tooling` | Tooling |
133+
| `enterprise` | Enterprise |
116134

117135
## Adding a New Pattern
118136

119137
1. Create `content/category/new-slug.json` with all required fields
120138
2. Update `prev`/`next` in the adjacent patterns' JSON files
121139
3. Run `jbang html-generators/generate.java`
140+
4. (Optional) Create translated content files under `translations/content/{locale}/category/new-slug.json` with only translatable fields — or let the AI translation workflow handle it
141+
142+
## Internationalization (i18n)
143+
144+
The site supports multiple languages. See `specs/i18n/i18n-spec.md` for the full specification.
145+
146+
### Key Concepts
147+
148+
- **UI strings:** Hard-coded template text (labels, nav, footer) is extracted into `translations/strings/{locale}.yaml`. Templates use `{{dotted.key}}` tokens (e.g., `{{nav.allPatterns}}`, `{{sections.codeComparison}}`). Missing keys fall back to the English value with a build-time warning.
149+
- **Content translations:** Translated pattern files under `translations/content/{locale}/` contain **only** translatable fields (`title`, `summary`, `explanation`, `oldApproach`, `modernApproach`, `whyModernWins`, `support.description`). All other fields (`oldCode`, `modernCode`, `slug`, `id`, `prev`, `next`, `related`, `docs`, etc.) are always taken from the English source.
150+
- **Locale registry:** `html-generators/locales.properties` lists supported locales (format: `locale=Display name`). The first entry is the default.
151+
- **English is a first-class locale:** All locales — including English — go through the same build pipeline.
152+
- **Fallback:** If a pattern has no translation file for a locale, the English content is used and an "untranslated" banner is shown.
153+
154+
### Supported Locales
155+
156+
Defined in `html-generators/locales.properties`:
157+
158+
| Locale | Display Name |
159+
|--------|-------------|
160+
| `en` | English |
161+
| `es` | Español |
162+
| `pt-BR` | Português (Brasil) |
163+
164+
### Content Translation File Example
165+
166+
Translation files contain **only** translatable fields — no structural data:
167+
168+
```json
169+
// translations/content/pt-BR/language/type-inference-with-var.json
170+
{
171+
"title": "Inferência de tipo com var",
172+
"oldApproach": "Tipos explícitos",
173+
"modernApproach": "Palavra-chave var",
174+
"summary": "Use var para deixar o compilador inferir o tipo local.",
175+
"explanation": "...",
176+
"whyModernWins": [
177+
{ "icon": "", "title": "Menos ruído", "desc": "..." },
178+
{ "icon": "👁", "title": "Mais legível", "desc": "..." },
179+
{ "icon": "🔒", "title": "Seguro", "desc": "..." }
180+
],
181+
"support": {
182+
"description": "Amplamente disponível desde o JDK 10 (março de 2018)"
183+
}
184+
}
185+
```
122186

123187
## Local Development
124188

0 commit comments

Comments
 (0)