Skip to content

Commit 7ac4618

Browse files
authored
docs: update (#250)
1 parent 2ab2f25 commit 7ac4618

2 files changed

Lines changed: 164 additions & 11 deletions

File tree

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
name: github-pr-comments
3+
description: Helps the agent fetch and interpret GitHub CLI / GraphQL queries for pull request review comments with line numbers and resolution status.
4+
---
5+
6+
# GitHub PR review comments skill
7+
8+
This skill guides the agent to use GitHub CLI and GraphQL to fetch pull request review comments with detailed context including line numbers and resolution status.
9+
10+
## When to use
11+
12+
- When the goal is to examine PR review threads, comments, and their status (resolved/outdated).
13+
- When you need to analyze or summarize PR feedback tied to specific files/lines.
14+
- When building tools or scripts that process GitHub PR comments programmatically.
15+
16+
## Instructions
17+
18+
1. Prefer the GitHub CLI GraphQL query shown below to get full review‑thread context, including resolution status and line numbers.
19+
2. Substitute `OWNER`, `REPO`, and `PR_NUMBER` with the correct values before running.
20+
3. If the response is paginated, use `endCursor` from `pageInfo` to iterate the next page until `hasNextPage` is `false`.
21+
22+
### Primary command (GraphQL – full‑featured)
23+
24+
Run this command in the terminal to fetch review threads with comments, paths, line numbers, and resolution status:
25+
26+
```bash
27+
gh api graphql -f query='
28+
query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) {
29+
repository(owner: $owner, name: $repo) {
30+
pullRequest(number: $prNumber) {
31+
reviewThreads(first: 100, after: $cursor) {
32+
pageInfo {
33+
hasNextPage
34+
endCursor
35+
}
36+
nodes {
37+
isResolved
38+
isOutdated
39+
comments(first: 20) {
40+
nodes {
41+
author {
42+
login
43+
}
44+
body
45+
path
46+
line
47+
startLine
48+
originalLine
49+
originalStartLine
50+
diffHunk
51+
createdAt
52+
updatedAt
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
}
60+
' -f owner=OWNER -f repo=REPO -F prNumber=PR_NUMBER
61+
---
62+
name: github-pr-comments
63+
description: Helps the agent fetch and interpret GitHub CLI / GraphQL queries for pull request review comments with line numbers and resolution status.
64+
---
65+
66+
# GitHub PR review comments skill
67+
68+
This skill guides the agent to use GitHub CLI and GraphQL to fetch pull request review comments with detailed context including line numbers and resolution status.
69+
70+
## When to use
71+
72+
- When the goal is to examine PR review threads, comments, and their status (resolved/outdated).
73+
- When you need to analyze or summarize PR feedback tied to specific files/lines.
74+
- When building tools or scripts that process GitHub PR comments programmatically.
75+
76+
## Instructions
77+
78+
1. Prefer the GitHub CLI GraphQL query shown below to get full review‑thread context, including resolution status and line numbers.
79+
2. Substitute `OWNER`, `REPO`, and `PR_NUMBER` with the correct values before running.
80+
3. If the response is paginated, use `endCursor` from `pageInfo` to iterate the next page until `hasNextPage` is `false`.
81+
82+
### Primary command (GraphQL – full‑featured)
83+
84+
Run this command in the terminal to fetch review threads with comments, paths, line numbers, and resolution status:
85+
86+
```bash
87+
gh api graphql -f query='
88+
query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) {
89+
repository(owner: $owner, name: $repo) {
90+
pullRequest(number: $prNumber) {
91+
reviewThreads(first: 100, after: $cursor) {
92+
pageInfo {
93+
hasNextPage
94+
endCursor
95+
}
96+
nodes {
97+
isResolved
98+
isOutdated
99+
comments(first: 20) {
100+
nodes {
101+
author {
102+
login
103+
}
104+
body
105+
path
106+
line
107+
startLine
108+
originalLine
109+
originalStartLine
110+
diffHunk
111+
createdAt
112+
updatedAt
113+
}
114+
}
115+
}
116+
}
117+
}
118+
}
119+
}
120+
' -f owner=OWNER -f repo=REPO -F prNumber=PR_NUMBER

.github/copilot-instructions.md

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
# Dont change any non test code without getting confirmation first
21

3-
Dont change any non test code without getting confirmation first. this is a very old application I'm working on making a thorough test suite for before making any changes
2+
# Code Changes
43

4+
This is a legacy codebase (2016) with a robust test suite added in 2024-25.
5+
6+
**Permitted without confirmation:**
7+
- Bug fixes with corresponding test coverage
8+
- Refactoring with existing test coverage
9+
- Removal of deprecated features (QuietHours, CalendarEditor)
10+
11+
**Requires tests first:**
12+
- New features or significant changes
13+
14+
When in doubt, add tests first.
515

616
# Work to make tests as faithful to the real code as possible
717

@@ -10,24 +20,47 @@ its ok to mock out core android apis that the instrumentation testsuite doesn't
1020

1121
# Don't try to boil the ocean. Dont try to make big sweeping changes when more focused ones will do
1222

13-
Always think of the minimum viable solution to a problem or change to make. make sure that works and then build on top of it. break things down into small testable pieces first. That said NO CHEATING! I.e. don't comment out or skip a test to solve a problem unless just a temporary bandaid while working on something more important.
23+
Always think of the minimum viable solution to a problem or change to make. make sure that works and then build on top of it. break things down into small testable pieces first. That said
24+
25+
**NO CHEATING!** I.e. don't comment out or skip a test to solve a problem unless its just a temporary bandaid while working on something more important.
1426

1527
# keep all code implementations as consise as possible.
1628

1729
Everything it needs nothing it doesn't. Every new line of code is one that potentially doesn't work 😄
1830

19-
# Please check the documentation if you are implementing something potentially complex or nonstandard.
2031

21-
often there are things we've learned already i.e.
32+
# Check documentation if implementing something potentially complex or nonstandard.
33+
34+
See `docs/README.md` for the full documentation index. often there are things we've learned already i.e.
35+
36+
**Key references:**
37+
38+
- `docs/dev_completed/constructor-mocking-android.md` - **MockK limitations**: `mockkStatic`, `mockkConstructor`, and `anyConstructed` almost always fail in Android instrumentation tests. Use dependency injection patterns instead.
39+
40+
- `docs/architecture/calendar_monitoring.md` - Deep detail on how calendar monitoring works (EVENT_REMINDER broadcasts, manual rescans, etc.)
41+
42+
- `docs/architecture/clock_implementation.md` - How `CNPlusClockInterface` enables testable time-dependent code
43+
44+
45+
# Copyright Headers
46+
47+
For new or updated copyright headers, use:
48+
49+
```
50+
Copyright (C) 2025 William Harris (wharris+cnplus@upscalews.com)
51+
```
52+
53+
(William inherited the application from Sergey Parshin in 2020)
2254

23-
docs/dev_completed/constructor-mocking-android.md
55+
# Never Catch the broad Exception class
2456

25-
documents how through a lot work an reserch we learned
57+
no catching Exception e. it can lead to hiding important bugs to catch. always do something more specific
2658

27-
mockKStatic, mockConstructor and anyConstructed ALMOST ALWAYS FAIL. And aren't worth trying anymore where there are better alternatives.
59+
# Never use System.currentTimeMillis() directly
2860

29-
also
61+
Use `CNPlusClockInterface` instead - it enables testable time-dependent code.
3062

31-
docs/calendar_monitoring.md
63+
**Production code:** Inject `CNPlusSystemClock()` or access via interface property
64+
**Test code:** Use `TestTimeConstants.STANDARD_TEST_TIME` or `CNPlusTestClock`
3265

33-
goes into DEEP detail about how calendar monitoring works in the app
66+
See `docs/architecture/clock_implementation.md` and `docs/dev_todo/system_current_time_millis_removal.md` for details.

0 commit comments

Comments
 (0)