@zeldrisho/pi-coderabbit-skills 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -13,5 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  - CodeRabbit `autofix` and `code-review` skills adapted for explicit invocation in Pi.
15
15
 
16
+ ### Changed
17
+
18
+ - Hardened autofix review-thread error handling and clarified manual invocation and authentication guidance for CodeRabbit reviews.
19
+
16
20
  [Unreleased]: https://github.com/zeldrisho/pi-packages/compare/pi-coderabbit-skills-v0.1.0...HEAD
17
21
  [0.1.0]: https://github.com/zeldrisho/pi-packages/releases/tag/pi-coderabbit-skills-v0.1.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeldrisho/pi-coderabbit-skills",
3
- "version": "0.0.0",
3
+ "version": "0.1.0",
4
4
  "description": "CodeRabbit skills packaged for Pi",
5
5
  "keywords": [
6
6
  "code-review",
@@ -22,26 +22,16 @@
22
22
  },
23
23
  "files": [
24
24
  "skills",
25
- "CHANGELOG.md",
26
- "LICENSE"
25
+ "CHANGELOG.md"
27
26
  ],
28
27
  "type": "module",
29
28
  "publishConfig": {
30
29
  "access": "public"
31
30
  },
32
- "scripts": {
33
- "check": "vp check",
34
- "test": "vp test",
35
- "test:watch": "vp test --watch",
36
- "lint": "vp lint",
37
- "lint:fix": "vp lint --fix",
38
- "format": "vp fmt --write",
39
- "typecheck": "vp check --no-fmt --no-lint"
40
- },
41
31
  "devDependencies": {
42
- "typescript": "catalog:",
43
- "vite": "catalog:",
44
- "vite-plus": "catalog:"
32
+ "typescript": "^7.0.2",
33
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
34
+ "vite-plus": "0.3.3"
45
35
  },
46
36
  "engines": {
47
37
  "node": ">=24"
@@ -50,5 +40,14 @@
50
40
  "skills": [
51
41
  "./skills"
52
42
  ]
43
+ },
44
+ "scripts": {
45
+ "check": "vp check",
46
+ "test": "vp test",
47
+ "test:watch": "vp test --watch",
48
+ "lint": "vp lint",
49
+ "lint:fix": "vp lint --fix",
50
+ "format": "vp fmt --write",
51
+ "typecheck": "vp check --no-fmt --no-lint"
53
52
  }
54
- }
53
+ }
@@ -97,7 +97,7 @@ while :; do
97
97
  args+=(-F cursor="$cursor")
98
98
  fi
99
99
 
100
- response=$(gh api graphql "${args[@]}" -f query='query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) {
100
+ if ! response=$(gh api graphql "${args[@]}" -f query='query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) {
101
101
  repository(owner:$owner, name:$repo) {
102
102
  pullRequest(number:$pr) {
103
103
  title
@@ -124,7 +124,15 @@ while :; do
124
124
  }
125
125
  }
126
126
  }
127
- }')
127
+ }'); then
128
+ echo "GitHub GraphQL request failed" >&2
129
+ exit 1
130
+ fi
131
+
132
+ if ! jq -e '(.errors == null or (.errors | length == 0)) and (.data.repository.pullRequest.reviewThreads.nodes | type == "array")' <<<"$response" >/dev/null; then
133
+ echo "GitHub GraphQL response contained errors or no review-thread data" >&2
134
+ exit 1
135
+ fi
128
136
 
129
137
  all_threads=$(jq -c --argjson response "$response" '
130
138
  . + $response.data.repository.pullRequest.reviewThreads.nodes
@@ -50,7 +50,7 @@ while :; do
50
50
  args+=(-F cursor="$cursor")
51
51
  fi
52
52
 
53
- response=$(gh api graphql "${args[@]}" -f query='query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) {
53
+ if ! response=$(gh api graphql "${args[@]}" -f query='query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) {
54
54
  repository(owner:$owner, name:$repo) {
55
55
  pullRequest(number:$pr) {
56
56
  title
@@ -77,7 +77,15 @@ while :; do
77
77
  }
78
78
  }
79
79
  }
80
- }')
80
+ }'); then
81
+ echo "GitHub GraphQL request failed" >&2
82
+ exit 1
83
+ fi
84
+
85
+ if ! jq -e '(.errors == null or (.errors | length == 0)) and (.data.repository.pullRequest.reviewThreads.nodes | type == "array")' <<<"$response" >/dev/null; then
86
+ echo "GitHub GraphQL response contained errors or no review-thread data" >&2
87
+ exit 1
88
+ fi
81
89
 
82
90
  all_threads=$(jq -c --argjson response "$response" '
83
91
  . + $response.data.repository.pullRequest.reviewThreads.nodes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: code-review
3
- description: "Run CodeRabbit CLI reviews, retrieve saved local or GitHub PR fix prompts, and interpret CodeRabbit authentication and review output. Use for CodeRabbit review commands, committed/uncommitted or directory scopes, and CodeRabbit runbooks. Default code-review skill: also trigger for explicit code/PR/quality/security review requests or when a review is needed."
3
+ description: "Run CodeRabbit CLI reviews, retrieve saved local or GitHub PR fix prompts, and interpret CodeRabbit authentication and review output. Use for CodeRabbit review commands, committed/uncommitted or directory scopes, and CodeRabbit runbooks."
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -60,7 +60,7 @@ Use `--agent` for output optimized for AI agents:
60
60
  coderabbit review --agent
61
61
  ```
62
62
 
63
- Run the review directly; the CLI starts browser authentication when needed, including a local callback flow in agent mode. Honor explicit no-login restrictions. If the execution environment hides host credentials or cannot open the callback, use the supported host execution path or hand off `coderabbit auth login`; do not read credential files or request pasted tokens. A sandbox authentication failure alone does not prove the user is logged out on the host.
63
+ Before running the review, ensure that the CLI is authenticated. If authentication is missing, use the supported host execution path or hand off `coderabbit auth login --agent`; do not read credential files or request pasted tokens. A sandbox authentication failure alone does not prove the user is logged out on the host.
64
64
 
65
65
  If the user asks to review a specific directory, append `--dir <path>`. The directory must be inside an initialized Git working tree.
66
66