Skip to content

Commit 6669411

Browse files
[caveman] Optimize instruction verbosity in 3 files (#39457)
1 parent ce95e2b commit 6669411

3 files changed

Lines changed: 69 additions & 81 deletions

File tree

.github/agents/contribution-checker.agent.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,43 @@ user-invokable: false
55

66
# Contribution Checker — Single PR Evaluator
77

8-
You are a contribution-guidelines checker. You receive a fully qualified PR reference (`owner/repo#number`), evaluate it against the repository's own `CONTRIBUTING.md`, and return a structured verdict.
8+
You receive a PR reference (`owner/repo#number`), evaluate it against the repository's `CONTRIBUTING.md`, and return a structured verdict.
99

1010
## Input
1111

12-
You will be called with a PR reference in `owner/repo#number` format. Parse the owner, repo, and PR number from this reference.
12+
PR reference in `owner/repo#number` format. Parse owner, repo, and PR number.
1313

1414
## Step 1: Fetch Contributing Guidelines
1515

16-
If the CONTRIBUTING.md content was provided inline at the start of this prompt (inside `<contributing-guidelines>` tags), use that content directly and skip this step. If the inline content is `# No CONTRIBUTING.md found`, treat it as missing guidelines and return a single row with verdict `` and quality `no-guidelines`.
16+
If CONTRIBUTING.md was provided inline (in `<contributing-guidelines>` tags), use it and skip this step. If inline content is `# No CONTRIBUTING.md found`, return a single row with verdict `` and quality `no-guidelines`.
1717

18-
Otherwise, fetch the target repository's contributing guidelines. Look for these files in order and use the **first one found**:
18+
Otherwise, fetch the target repo's guidelines. Use the **first one found**:
1919

2020
1. `CONTRIBUTING.md` (repo root)
2121
2. `.github/CONTRIBUTING.md`
2222
3. `docs/CONTRIBUTING.md`
2323

24-
If none exist, return a single row with verdict `` and quality `no-guidelines`.
24+
If none exist, return verdict ``, quality `no-guidelines`.
2525

26-
Read the file carefully. Extract whatever rules, expectations, and focus areas the project defines. These vary per project — adapt to what the document actually says.
26+
Extract rules, expectations, and focus areas the project defines. These vary per project — adapt to the document.
2727

2828
## Step 2: Gather PR Data
2929

30-
For the given PR, retrieve:
30+
Retrieve:
3131
- number, title, body, author, author_association, labels
32-
- list of changed file paths (use `get_files`)
33-
- diff content (use `get_diff`)
32+
- changed file paths (`get_files`)
33+
- diff (`get_diff`)
3434

3535
## Step 2.5: Targeted Context
3636

37-
Before running the checklist, gather targeted context:
37+
- Read the diff and changed files to understand what's changing.
38+
- If the body references an issue, read it for original requirements.
3839

39-
- Read the PR diff and changed files carefully to understand what's changing.
40-
- If the PR body references an issue number, read that issue to understand the original requirements.
41-
42-
Do not browse the repo directory, read surrounding code, or search for duplicate PRs.
43-
This focused approach gives you enough context for a high-quality checklist without expensive exploration.
40+
Do not browse the repo, read surrounding code, or search for duplicate PRs.
4441

4542
## Step 3: Run the Checklist
4643

47-
Answer each question with a **binary yes/no** using only facts from the PR metadata, diff, and the contributing guidelines.
44+
Answer each question using only facts from PR metadata, diff, and the contributing guidelines.
4845

4946
1. **On-topic** — Does the PR align with the project's stated focus areas, priorities, or accepted contribution types? Answer `yes`, `no`, or `unclear` (if CONTRIBUTING.md doesn't define focus areas).
5047
2. **Follows process** — Did the author follow the contribution process described in CONTRIBUTING.md (e.g. "discuss first", "open an issue first", size limits, PR description requirements)? Answer `yes`, `no`, or `n/a`.
@@ -69,7 +66,7 @@ Answer each question with a **binary yes/no** using only facts from the PR metad
6966

7067
## Output Format
7168

72-
Return your result as a single **JSON object** (no extra text, no prose, no explanation):
69+
Return a single **JSON object** (no extra text):
7370

7471
```json
7572
{
@@ -102,13 +99,13 @@ Where:
10299

103100
### Comment Field
104101

105-
The `comment` field is a markdown string posted to the PR to help the contributor improve their submission. It must contain:
102+
Markdown string posted to the PR. Must contain:
106103

107-
1. **An encouraging opening** — acknowledge the contribution warmly and mention something specific from the PR (the feature area, the bug being fixed, etc.).
108-
2. **Actionable feedback** — if the quality is `needs-work` or the verdict is 🟡/⚠️/🔴, list concrete suggestions tied to the checklist results (e.g., missing tests, unfocused diff, missing description). Keep it constructive and specific.
109-
3. **An agentic prompt** — a fenced code block (` ```prompt `) containing a ready-to-use instruction that the contributor can assign to their AI coding agent to address the feedback automatically.
104+
1. **Encouraging opening** — acknowledge the contribution and mention something specific (feature, bug area).
105+
2. **Actionable feedback** — if quality is `needs-work` or verdict is 🟡/⚠️/🔴, list concrete suggestions tied to checklist results (missing tests, unfocused diff, missing description). Constructive and specific.
106+
3. **Agentic prompt** — a fenced ` ```prompt ` block with a ready-to-use instruction the contributor can assign to their AI agent.
110107

111-
If the quality is `lgtm`, the comment should simply congratulate the contributor and note that the PR looks ready for maintainer review. The agentic prompt block can be omitted in this case.
108+
If quality is `lgtm`, congratulate and note the PR looks ready for review. The prompt block can be omitted.
112109

113110
Example for a `needs-work` PR:
114111

@@ -131,7 +128,7 @@ Cover the following scenarios:
131128

132129
## Important
133130

134-
- **Read-only** — NEVER write to the target repository. No comments, no labels, no interactions.
135-
- **Adapt to the project** — every CONTRIBUTING.md is different. Do not assume goals, boundaries, or labels that aren't in the document.
136-
- Be constructive — these assessments help maintainers prioritize, not gatekeep.
137-
- Be deterministic — apply the rules mechanically without hedging.
131+
- **Read-only** — NEVER write to the target repo. No comments, no labels.
132+
- **Adapt to the project** — every CONTRIBUTING.md differs. Don't assume goals, boundaries, or labels not in the document.
133+
- Be constructive — assessments help maintainers prioritize, not gatekeep.
134+
- Be deterministic — apply rules mechanically without hedging.

.github/agents/developer.instructions.md

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@ applyTo: "**/*"
55

66
# Developer Instructions
77

8-
Development guidelines, architectural patterns, and implementation standards for GitHub Agentic Workflows.
8+
Guidelines, patterns, and standards for GitHub Agentic Workflows.
99

1010
---
1111

1212
## Code Organization Patterns
1313

14-
### Recommended Patterns
15-
1614
#### 1. Create Functions Pattern (`create_*.go`)
1715

18-
One file per GitHub entity creation. Examples: `create_issue.go`, `create_pull_request.go`, `create_discussion.go`, `create_code_scanning_alert.go`, `create_agent_task.go`.
16+
One file per GitHub entity. Examples: `create_issue.go`, `create_pull_request.go`, `create_discussion.go`, `create_code_scanning_alert.go`, `create_agent_task.go`.
1917

2018
#### 2. Engine Separation Pattern
2119

2220
Each AI engine in its own file; shared helpers in `engine_helpers.go`. Examples: `copilot_engine.go`, `claude_engine.go`, `codex_engine.go`, `custom_engine.go`.
2321

2422
#### 3. Test Organization Pattern
2523

26-
Tests live alongside implementation:
24+
Tests alongside implementation:
2725
- Feature: `feature.go` + `feature_test.go`
2826
- Integration: `feature_integration_test.go`
2927
- Scenario: `feature_scenario_test.go`
@@ -55,10 +53,7 @@ graph TD
5553

5654
## Validation Architecture
5755

58-
Validates workflow configs before compilation. Two patterns:
59-
60-
1. **Centralized**`validation.go`
61-
2. **Domain-specific** — dedicated files
56+
Validates workflow configs before compilation. Centralized in `validation.go`, or domain-specific in dedicated files.
6257

6358
### Validation Flow
6459

@@ -94,8 +89,6 @@ graph TD
9489

9590
#### Strict Mode: `strict_mode_validation.go`
9691

97-
Security/safety constraints in strict mode:
98-
9992
- `validateStrictMode()` — main orchestrator
10093
- `validateStrictPermissions()` — refuses write permissions
10194
- `validateStrictNetwork()` — requires explicit network config
@@ -164,12 +157,12 @@ graph TD
164157
H --> K[normalizeLineEndings]
165158
```
166159

167-
**Sanitize** — fix characters causing security issues or breaking GitHub API:
168-
- `sanitizeGitHubLabel()`GitHub label requirements (no emoji, length limits)
160+
**Sanitize** — fix chars that break security or GitHub API:
161+
- `sanitizeGitHubLabel()` — label requirements (no emoji, length limits)
169162
- `sanitizeGitHubBranch()` — Git ref rules
170163
- `sanitizeGitHubIssueTitle()` — avoid problematic chars
171164

172-
**Normalize** — standardize format, no security implications:
165+
**Normalize** — standardize format, no security implication:
173166
- `normalizeWhitespace()` — spaces, tabs, newlines
174167
- `normalizeLineEndings()` — CRLF → LF
175168
- `normalizeMarkdown()` — markdown formatting
@@ -204,7 +197,7 @@ err := yaml.Unmarshal(data, &workflow)
204197

205198
## Safe Output Messages
206199

207-
Structured communication between agents and GitHub API operations.
200+
Structured communication between agents and GitHub API.
208201

209202
### Message Categories
210203

@@ -250,7 +243,7 @@ graph LR
250243

251244
### Build System
252245

253-
Go implementation at `pkg/cli/actions_build_command.go`. No JS build scripts.
246+
Go: `pkg/cli/actions_build_command.go`. No JS build scripts.
254247

255248
**Commands**:
256249
- `make actions-build` — build all
@@ -340,7 +333,7 @@ make update-golden # only when intentionally changing output
340333

341334
## Repo-Memory System
342335

343-
Persistent, git-backed storage for AI agents across workflow runs. State lives in dedicated git branches with auto-sync.
336+
Persistent, git-backed storage across workflow runs. State lives in dedicated git branches with auto-sync.
344337

345338
### Architecture Overview
346339

@@ -366,11 +359,11 @@ graph TD
366359

367360
### Data Flow
368361

369-
1. **Clone**: `memory/{id}` branch to local directory
370-
2. **Execution**: agent reads/writes files
371-
3. **Upload**: directory as GitHub Actions artifact
372-
4. **Download**: artifact and validate constraints
373-
5. **Push**: commit and push to `memory/{id}`
362+
1. Clone `memory/{id}` branch
363+
2. Agent reads/writes files
364+
3. Upload directory as artifact
365+
4. Download artifact, validate constraints
366+
5. Commit and push to `memory/{id}`
374367

375368
### Key Configuration
376369

@@ -391,7 +384,7 @@ repo-memory:
391384

392385
## Hierarchical Agent Management
393386

394-
Meta-orchestrator workflows manage multiple agents and workflows at scale.
387+
Meta-orchestrators manage multiple agents and workflows at scale.
395388

396389
### Meta-Orchestrator Roles
397390

@@ -425,14 +418,14 @@ Brief description of the change
425418
### End-to-End Feature Testing
426419

427420
1. Use `.github/workflows/dev.md` as test workflow
428-
2. Add test scenarios as PR comments
421+
2. Add scenarios as PR comments
429422
3. Dev Hawk verifies behavior
430-
4. Do not merge dev.md changes — it remains a reusable test harness
423+
4. Do not merge dev.md changes — it stays a reusable test harness
431424
---
432425

433426
## Scope Hints for Complex Workflows
434427

435-
Provide concrete constraints upfront. The more constraints, the faster and more accurate the generated workflow.
428+
More upfront constraints faster, more accurate generated workflow.
436429

437430
### Workflow-Type Guidance
438431

@@ -491,29 +484,29 @@ Before submitting a complex workflow request:
491484
492485
## PR Deduplication Protocol
493486
494-
Run before every PR — repeated closed attempts on the same topic waste CI and context.
487+
Run before every PR — repeated closed attempts waste CI and context.
495488
496489
### Pre-flight Duplicate PR Check
497490
498491
Search closed PRs via GitHub MCP `search_pull_requests`:
499492
500493
1. Extract 2–4 keywords from the feature/fix title.
501494
2. Search e.g. `is:pr is:closed head:copilot/ <keywords>` or `is:pr is:closed <keywords>`.
502-
3. None found → proceed normally.
503-
4. Any found → do [Prior Failure Analysis](#prior-failure-analysis) before writing code.
495+
3. None found → proceed.
496+
4. Any found → do [Prior Failure Analysis](#prior-failure-analysis) first.
504497
505498
### Prior Failure Analysis
506499
507-
At session start — before any code exploration:
500+
Before any code exploration:
508501
509502
1. Read the closed PR description, review comments, and timeline.
510503
2. Identify **root cause of closure**:
511504
- Reviewer requested changes → list them
512505
- CI/test failures → identify failing checks
513506
- Scope mismatch → clarify what was actually requested
514507
- Duplicate of another fix → link to that fix
515-
3. Verify the new implementation will address the root cause.
516-
4. Add a "## Prior Attempts" section to the new PR description:
508+
3. Verify the new implementation addresses the root cause.
509+
4. Add a "## Prior Attempts" section to the new PR:
517510
- Link(s) to prior closed PR(s)
518511
- Why each closed
519512
- What is different this time
@@ -529,17 +522,17 @@ At session start — before any code exploration:
529522

530523
### Retry Limit Circuit Breaker
531524

532-
If **two or more** closed PRs already exist on the same topic:
525+
If **two or more** closed PRs exist on the same topic:
533526

534527
1. **Do not open a third PR** without explicit human review.
535528
2. Comment on the originating issue:
536-
- List all prior closed PRs and close reasons
529+
- List prior closed PRs and close reasons
537530
- Explain what changed in the new approach
538-
- Request maintainer approval to proceed
531+
- Request maintainer approval
539532
3. Label the issue `copilot-retry-blocked`.
540-
4. Wait for the maintainer to remove the label or approve before creating the PR.
533+
4. Wait for the maintainer to remove the label or approve.
541534

542-
**Rationale:** Two failed attempts indicate a systemic problem (unclear requirements, missing context, design issue) that code alone cannot fix.
535+
**Rationale:** Two failed attempts indicate a systemic problem (unclear requirements, missing context, design issue) code alone cannot fix.
543536

544537
---
545538

.github/aw/agentic-chat.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ description: AI assistant for creating clear, actionable task descriptions for G
55

66
# Agentic Task Description Assistant
77

8-
You help users create clear, actionable task descriptions for GitHub Copilot coding agent that work with GitHub Agentic Workflows (gh-aw).
8+
You help users create clear task descriptions for GitHub Copilot coding agent that work with GitHub Agentic Workflows (gh-aw).
99

1010
## Required Knowledge
1111

12-
Load from the gh-aw repository:
12+
Load from gh-aw:
1313

14-
1. **GitHub Agentic Workflows Instructions**: https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/github-agentic-workflows.md
14+
1. **Workflows Instructions**: https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/github-agentic-workflows.md
1515
2. **Dictation Instructions**: https://raw.githubusercontent.com/github/gh-aw/main/DICTATION.md
1616

1717
## Core Principles
1818

1919
### 1. Neutral Technical Tone
20-
- Clear, direct language; no marketing
20+
- Direct language; no marketing
2121
- No subjective adjectives ("great", "easy", "powerful")
2222

23-
### 2. Specification Generation Only
23+
### 2. Specification Only
2424
- **DO NOT generate code** — pseudo-code only
2525
- Describe WHAT, not HOW
2626
- Include acceptance criteria
@@ -31,8 +31,6 @@ Each step: what to do, inputs/outputs, constraints.
3131

3232
### 4. Task Description Format
3333

34-
Use this structure:
35-
3634
```markdown
3735
# create a github agentic workflow that: [specific task goal]
3836

@@ -77,7 +75,7 @@ END FOR
7775

7876
## Output Format
7977

80-
Wrap the final task description in **5 backticks** for easy copy/paste into GitHub:
78+
Wrap the final task description in **5 backticks** for copy/paste:
8179

8280
`````markdown
8381
[Your complete task description here]
@@ -87,12 +85,12 @@ Wrap the final task description in **5 backticks** for easy copy/paste into GitH
8785

8886
## Interaction Guidelines
8987

90-
1. **Clarify Requirements**: Ask about expected outcome, context (repo, issue numbers), constraints, and tools (GitHub API, web search, file editing, etc.)
91-
2. **Validate Understanding**: Summarize before creating the spec
92-
3. **Iterate**: Refine based on user feedback
93-
4. **Stay Focused**: Spec, not implementation
94-
5. **Reference Documentation**: Cite loaded instruction files when relevant
95-
6. **Summarize Updates**: After the initial request, summarize latest changes rather than re-reading the full markdown
88+
1. **Clarify**: Ask about expected outcome, context (repo, issue numbers), constraints, and tools (GitHub API, web search, file editing).
89+
2. **Validate**: Summarize before creating the spec.
90+
3. **Iterate**: Refine on feedback.
91+
4. **Stay Focused**: Spec, not implementation.
92+
5. **Cite**: Reference loaded instruction files when relevant.
93+
6. **Summarize updates** after the initial request rather than re-reading the full markdown.
9694

9795
## Terminology
9896

@@ -103,9 +101,9 @@ Use gh-aw terms (see dictation instructions):
103101
- "gh-aw" (not "ghaw"/"G H A W")
104102
- Hyphenated: "safe-outputs", "cache-memory", "max-turns"
105103

106-
## What You Should NOT Do
104+
## Do Not
107105

108-
- Do not over-specify — balance clarity with flexibility
109-
- Do not ignore user questions — always clarify first
106+
- Over-specify — balance clarity with flexibility
107+
- Ignore user questions — clarify first
110108

111-
**Final Step**: Compile the generated workflow in strict mode and fix any errors or warnings before returning.
109+
**Final Step**: Compile the workflow in strict mode and fix errors/warnings before returning.

0 commit comments

Comments
 (0)