Skip to content

Commit 2357984

Browse files
committed
Added Junie guidelines
1 parent cfc8580 commit 2357984

File tree

3 files changed

+91
-12
lines changed

3 files changed

+91
-12
lines changed

.github/copilot-instructions.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,52 @@
33
Purpose: Helper source files (embedded) for .NET incremental generators; keep output deterministic and public API stable.
44

55
## 1. Scope
6-
Chat = terse (summary + reason + minimal diff). Repo docs = rich (rationale, examples, edge cases, perf). Additive edits only.
6+
Chat = terse (summary + reason + minimal sample). Repo docs = rich (rationale, examples, edge cases, perf). Additive = new files/members only; no deletions, renames, or moves unless explicitly requested.
77

88
## 2. Platform & Stability
99
netstandard2.0 / C# 7.3. No newer BCL APIs. Preserve public type & member names.
1010

1111
## 3. Guards
12-
Each helper file:
12+
Each helper file can be excluded from the build using a guard.
13+
Nest or document dependencies using guards, depending on how closely related the helper file is to the dependency.
14+
Closely related examples:
1315
```
14-
#if !DATACUTE_EXCLUDE_<UPPERCASENAME>
16+
#if !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAYEXTENSIONS // Feature: EquatableImmutableArrayExtensions
17+
#if !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY // Dependency: EquatableImmutableArray
1518
// contents
19+
#endif // !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY
20+
#endif // !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAYEXTENSIONS
21+
```
22+
Not closely related examples:
23+
```
24+
#if !DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA // Feature: AttributeContextAndData
25+
#if DATACUTE_EXCLUDE_TYPECONTEXT
26+
#error AttributeContextAndData requires TypeContext (remove DATACUTE_EXCLUDE_TYPECONTEXT or also exclude DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA)
27+
#endif
28+
#if DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY
29+
#error AttributeContextAndData requires EquatableImmutableArray (remove DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY or also exclude DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA)
1630
#endif
31+
// contents
32+
#endif // !DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA
1733
```
18-
Nest or document dependencies.
1934

20-
## 4. Editing & Diffs
21-
Show only changed lines (≤3 lines context). Fenced blocks for multi‑line examples. Short reason (perf / determinism / clarity / bug fix). No change‑log comments. UK English.
35+
## 4. Editing & Samples
36+
Show only example code snippets (no diffs) with ≤3 lines of surrounding context when needed. Fenced blocks for multi‑line examples. Use code samples to illustrate changes; do not use diff syntax in chat. Use language tags: csharp for C# code, xml for XML docs, and text for plain text. Short reason (perf / determinism / clarity / bug fix). Keep commentary in the chat. Code changes must omit commentary. Resulting code must look like it was always written that way.
37+
38+
When showing a change, prefer Before/After paired samples:
39+
- Before: the minimal original snippet required for context.
40+
- After: the revised snippet in full.
41+
42+
## 5. Public API Doc Comments
43+
For every public type or member emit an XML doc summary (no placeholders). Include <param>/<typeparam>/<returns> when present; only add <remarks> if non-trivial behaviour (threading, allocation, ordering, invariants).
2244

23-
## 5. Documentation
24-
XML doc first sentence = summary; follow with behaviour / perf / pitfalls if useful. READMEs may include: Overview, Why, Key APIs, Examples, Performance, Dependencies, Exclusion Flags, Instrumentation. Document public surface only (internal/private only if cross‑file contract). Chat brevity does not apply to repo docs.
45+
## 6. Documentation
46+
UK English. XML doc first sentence = summary; follow with behaviour / perf / pitfalls if useful. READMEs may include: Overview, Why, Key APIs, Examples, Performance, Dependencies, Exclusion Flags, Instrumentation. Document public surface only (internal/private only if cross‑file contract). Chat brevity does not apply to repo docs.
2547

26-
## 6. Chat Response Format
27-
1. Summary (1–2 lines) 2. Diff (changed lines) OR fenced example 3. Optional next steps (label “Optional”).
48+
## 7. Chat Response Format
49+
1. Summary (1–2 lines)
50+
2. Example code snippet(s) only (no diff format)
51+
3. Optional next steps (label “Optional”).
2852

29-
## 7. Assumptions
30-
If unspecified, state one reversible assumption and proceed.
53+
## 8. Assumptions
54+
If unspecified, state one reversible assumption in the chat and proceed.

.junie/guidelines.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Internal Agent Instructions
2+
3+
Purpose: Helper source files (embedded) for .NET incremental generators; keep output deterministic and public API stable.
4+
5+
## 1. Scope
6+
Chat = terse (summary + reason + minimal sample). Repo docs = rich (rationale, examples, edge cases, perf). Additive = new files/members only; no deletions, renames, or moves unless explicitly requested.
7+
8+
## 2. Platform & Stability
9+
netstandard2.0 / C# 7.3. No newer BCL APIs. Preserve public type & member names.
10+
11+
## 3. Guards
12+
Each helper file can be excluded from the build using a guard.
13+
Nest or document dependencies using guards, depending on how closely related the helper file is to the dependency.
14+
Closely related examples:
15+
```
16+
#if !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAYEXTENSIONS // Feature: EquatableImmutableArrayExtensions
17+
#if !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY // Dependency: EquatableImmutableArray
18+
// contents
19+
#endif // !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY
20+
#endif // !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAYEXTENSIONS
21+
```
22+
Not closely related examples:
23+
```
24+
#if !DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA // Feature: AttributeContextAndData
25+
#if DATACUTE_EXCLUDE_TYPECONTEXT
26+
#error AttributeContextAndData requires TypeContext (remove DATACUTE_EXCLUDE_TYPECONTEXT or also exclude DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA)
27+
#endif
28+
#if DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY
29+
#error AttributeContextAndData requires EquatableImmutableArray (remove DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY or also exclude DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA)
30+
#endif
31+
// contents
32+
#endif // !DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA
33+
```
34+
35+
## 4. Editing & Samples
36+
Show only example code snippets (no diffs) with ≤3 lines of surrounding context when needed. Fenced blocks for multi‑line examples. Use code samples to illustrate changes; do not use diff syntax in chat. Use language tags: csharp for C# code, xml for XML docs, and text for plain text. Short reason (perf / determinism / clarity / bug fix). Keep commentary in the chat. Code changes must omit commentary. Resulting code must look like it was always written that way.
37+
38+
When showing a change, prefer Before/After paired samples:
39+
- Before: the minimal original snippet required for context.
40+
- After: the revised snippet in full.
41+
42+
## 5. Public API Doc Comments
43+
For every public type or member emit an XML doc summary (no placeholders). Include <param>/<typeparam>/<returns> when present; only add <remarks> if non-trivial behaviour (threading, allocation, ordering, invariants).
44+
45+
## 6. Documentation
46+
UK English. XML doc first sentence = summary; follow with behaviour / perf / pitfalls if useful. READMEs may include: Overview, Why, Key APIs, Examples, Performance, Dependencies, Exclusion Flags, Instrumentation. Document public surface only (internal/private only if cross‑file contract). Chat brevity does not apply to repo docs.
47+
48+
## 7. Chat Response Format
49+
1. Summary (1–2 lines)
50+
2. Example code snippet(s) only (no diff format)
51+
3. Optional next steps (label “Optional”).
52+
53+
## 8. Assumptions
54+
If unspecified, state one reversible assumption in the chat and proceed.

IncrementalGeneratorExtensions.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1212
PACKAGE_README.md = PACKAGE_README.md
1313
.github\copilot-instructions.md = .github\copilot-instructions.md
1414
global.json = global.json
15+
.junie\guidelines.md = .junie\guidelines.md
1516
EndProjectSection
1617
EndProject
1718
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IncrementalGeneratorExtensions", "IncrementalGeneratorExtensions\IncrementalGeneratorExtensions.csproj", "{2DDE40FD-08D6-469C-948A-2AED9E0B2B49}"

0 commit comments

Comments
 (0)