@kolatts/pncli 1.8.0 → 1.10.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/copilot-instructions.md +268 -8
- package/dist/{chunk-QQ7UKWTU.js → chunk-3XHTRFRX.js} +108 -1
- package/dist/chunk-3XHTRFRX.js.map +1 -0
- package/dist/{chunk-S4SJLY4M.js → chunk-O3LWAWSN.js} +45 -1
- package/dist/chunk-O3LWAWSN.js.map +1 -0
- package/dist/cli.js +1016 -60
- package/dist/cli.js.map +1 -1
- package/dist/{config-PXL632ZX.js → config-NCI2BTQG.js} +2 -2
- package/dist/{http-TID3W235.js → http-L2P23H2D.js} +2 -2
- package/package.json +2 -1
- package/skills/address-pr-feedback/SKILL.md +87 -0
- package/skills/code-review/SKILL.md +82 -0
- package/skills/local-setup/SKILL.md +225 -0
- package/skills/plan/SKILL.md +120 -0
- package/skills/security-review/SKILL.md +108 -0
- package/skills/ship/SKILL.md +170 -0
- package/dist/chunk-QQ7UKWTU.js.map +0 -1
- package/dist/chunk-S4SJLY4M.js.map +0 -1
- /package/dist/{config-PXL632ZX.js.map → config-NCI2BTQG.js.map} +0 -0
- /package/dist/{http-TID3W235.js.map → http-L2P23H2D.js.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
setRepoConfigValue,
|
|
8
8
|
writeGlobalConfig,
|
|
9
9
|
writeRepoConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-O3LWAWSN.js";
|
|
11
11
|
export {
|
|
12
12
|
getGlobalConfigPath,
|
|
13
13
|
loadConfig,
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
writeGlobalConfig,
|
|
18
18
|
writeRepoConfig
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=config-
|
|
20
|
+
//# sourceMappingURL=config-NCI2BTQG.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolatts/pncli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "The Paperwork Nightmare CLI — One command does what three meetings couldn't.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"license": "Apache-2.0",
|
|
51
51
|
"files": [
|
|
52
52
|
"dist",
|
|
53
|
+
"skills",
|
|
53
54
|
"LICENSE",
|
|
54
55
|
"NOTICE",
|
|
55
56
|
"README.md",
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: address-pr-feedback
|
|
3
|
+
description: Work through all open review comments and SonarQube issues on the current branch's PR. Auto-fixes linting and SonarQube findings; applies AI judgment to reviewer comments. Shows a summary table, then asks user to commit and push before marking threads resolved. Use when asked to address feedback, resolve PR comments, or respond to change requests.
|
|
4
|
+
compatibility: Designed for Claude Code. Requires pncli configured with Bitbucket or Azure DevOps and optionally SonarQube.
|
|
5
|
+
user-invocable: true
|
|
6
|
+
metadata:
|
|
7
|
+
category: pr-workflow
|
|
8
|
+
providers: both
|
|
9
|
+
services: git, bitbucket, ado, sonar
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1 — Detect provider
|
|
13
|
+
|
|
14
|
+
Run `git remote -v`. `/_git/` in the URL → Azure DevOps. `/scm/` → Bitbucket.
|
|
15
|
+
|
|
16
|
+
## Step 2 — RESEARCH: Gather all open feedback (parallel)
|
|
17
|
+
|
|
18
|
+
Launch three tasks simultaneously:
|
|
19
|
+
|
|
20
|
+
**Task A — Open PR comments**
|
|
21
|
+
|
|
22
|
+
Bitbucket: `pncli bitbucket get-pr` to get the PR id, then `pncli bitbucket list-comments --pr <id>` filtered to `resolved: false`.
|
|
23
|
+
ADO: `pncli ado repo list-prs --state active` filtered by current branch to get PR id, then `pncli ado repo list-comments --pr <id>` filtered to threads where `status` is not `fixed`.
|
|
24
|
+
|
|
25
|
+
**Task B — SonarQube issues**
|
|
26
|
+
|
|
27
|
+
Get current branch: `git rev-parse --abbrev-ref HEAD`
|
|
28
|
+
Run `pncli sonar issues --statuses OPEN --branch <branch>`
|
|
29
|
+
Report: rule key, severity, file, line, message for each open issue.
|
|
30
|
+
|
|
31
|
+
**Task C — Source context**
|
|
32
|
+
|
|
33
|
+
For every comment in Task A that references a file path, read that file in full from the working tree.
|
|
34
|
+
|
|
35
|
+
Wait for all three tasks.
|
|
36
|
+
|
|
37
|
+
## Step 3 — PLAN: Classify each item
|
|
38
|
+
|
|
39
|
+
For every comment and SonarQube issue, assign one action:
|
|
40
|
+
|
|
41
|
+
- **AUTO-FIX** — SonarQube issues; comments explicitly about linting, formatting, or code style rules
|
|
42
|
+
- **AGREED-FIX** — Reviewer threads where a reply from the PR author (or submitter) contains an agreement signal: "sounds good", "will fix", "done", "agreed", "fixed", "+1", "yep", "sure"
|
|
43
|
+
- **AI-JUDGMENT** — Everything else. Apply best judgment to determine the correct fix. Do not skip.
|
|
44
|
+
|
|
45
|
+
## Step 4 — IMPLEMENT: Apply all fixes
|
|
46
|
+
|
|
47
|
+
Process AUTO-FIX and AGREED-FIX items first, then AI-JUDGMENT items.
|
|
48
|
+
|
|
49
|
+
For each item: edit the referenced file(s) directly to resolve the finding.
|
|
50
|
+
Track as you go: `(comment id or sonar key) → (action taken) → (file:line changed)`.
|
|
51
|
+
|
|
52
|
+
## Step 5 — Show summary table
|
|
53
|
+
|
|
54
|
+
Print a Markdown table of everything addressed:
|
|
55
|
+
|
|
56
|
+
| Comment / Finding | Author | Action | File Changed |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| ... | ... | ... | ... |
|
|
59
|
+
|
|
60
|
+
## Step 6 — Ask user to commit and push
|
|
61
|
+
|
|
62
|
+
Do NOT auto-commit or auto-push. Print:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
All fixes applied. Review the changes above, then:
|
|
66
|
+
git add <changed files>
|
|
67
|
+
git commit -m "fix: address PR review feedback"
|
|
68
|
+
git push
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Wait for the user to confirm they have pushed before proceeding to Step 7.
|
|
72
|
+
|
|
73
|
+
## Step 7 — Reply to and resolve each thread
|
|
74
|
+
|
|
75
|
+
After the user confirms the push, for each addressed item:
|
|
76
|
+
|
|
77
|
+
**Bitbucket:**
|
|
78
|
+
```
|
|
79
|
+
pncli bitbucket reply-comment --pr <id> --comment-id <cid> --body "Fixed — <one-line description>"
|
|
80
|
+
pncli bitbucket resolve-comment --pr <id> --comment-id <cid>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**ADO:**
|
|
84
|
+
```
|
|
85
|
+
pncli ado repo reply-comment --pr <id> --thread-id <tid> --body "Fixed — <one-line description>"
|
|
86
|
+
pncli ado repo resolve-comment --pr <id> --thread-id <tid>
|
|
87
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Review the PR for the current branch. Reads the full diff, existing comments, and referenced source files, then posts categorized inline comments (Blocking / Suggestion / Nit) via pncli. Offers to approve or request changes at the end. Works with Bitbucket and Azure DevOps. Use when asked to review a PR, check the diff, or add code review comments.
|
|
4
|
+
compatibility: Designed for Claude Code. Requires pncli configured with Bitbucket or Azure DevOps.
|
|
5
|
+
user-invocable: true
|
|
6
|
+
metadata:
|
|
7
|
+
category: pr-workflow
|
|
8
|
+
providers: both
|
|
9
|
+
services: git, bitbucket, ado
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1 — Detect provider
|
|
13
|
+
|
|
14
|
+
Run `git remote -v`. `/_git/` → Azure DevOps. `/scm/` → Bitbucket.
|
|
15
|
+
|
|
16
|
+
## Step 2 — Find the PR for the current branch
|
|
17
|
+
|
|
18
|
+
Get current branch: `git rev-parse --abbrev-ref HEAD`
|
|
19
|
+
|
|
20
|
+
**Bitbucket:** `pncli git current-pr` → returns PR id.
|
|
21
|
+
**ADO:** `pncli ado repo list-prs --state active`, filter entries where `sourceRefName` ends with the current branch name.
|
|
22
|
+
|
|
23
|
+
## Step 3 — RESEARCH: Read diff, comments, and source files (parallel)
|
|
24
|
+
|
|
25
|
+
Launch three agents simultaneously:
|
|
26
|
+
|
|
27
|
+
**Agent A — Full diff**
|
|
28
|
+
Bitbucket: `pncli bitbucket diff --pr <id>`
|
|
29
|
+
ADO: `pncli ado repo diff --pr <id>`
|
|
30
|
+
Parse: file paths, change type (add/edit/delete), added and removed line numbers.
|
|
31
|
+
|
|
32
|
+
**Agent B — Existing comments**
|
|
33
|
+
Bitbucket: `pncli bitbucket list-comments --pr <id>`
|
|
34
|
+
ADO: `pncli ado repo list-comments --pr <id>`
|
|
35
|
+
Note which file+line combinations already have comments — do not duplicate them.
|
|
36
|
+
|
|
37
|
+
**Agent C — Source context**
|
|
38
|
+
For each file that appears in the diff: read the full file from the working tree.
|
|
39
|
+
Also read `CLAUDE.md` (or any repo conventions file) if present in the repo root.
|
|
40
|
+
|
|
41
|
+
Wait for all three agents.
|
|
42
|
+
|
|
43
|
+
## Step 4 — PLAN: Classify each finding
|
|
44
|
+
|
|
45
|
+
Analyze the diff against the full source context and existing comments.
|
|
46
|
+
For each issue found, assign a category:
|
|
47
|
+
|
|
48
|
+
- **Blocking** — correctness bug, security vulnerability, broken contract, data loss risk, undefined behavior
|
|
49
|
+
- **Suggestion** — better approach available, missing test coverage, unclear naming, performance concern, missing error handling at a boundary
|
|
50
|
+
- **Nit** — style preference, whitespace, minor naming, cosmetic
|
|
51
|
+
|
|
52
|
+
Skip any finding already covered by an existing comment on the same line.
|
|
53
|
+
|
|
54
|
+
## Step 5 — IMPLEMENT: Post inline comments
|
|
55
|
+
|
|
56
|
+
Post findings in order: Blocking first, then Suggestion, then Nit.
|
|
57
|
+
|
|
58
|
+
**Bitbucket:**
|
|
59
|
+
```
|
|
60
|
+
pncli bitbucket add-inline-comment --pr <id> --file <path> --line <n> \
|
|
61
|
+
--body "[Blocking|Suggestion|Nit] <finding>"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**ADO:**
|
|
65
|
+
```
|
|
66
|
+
pncli ado repo add-inline-comment --pr <id> --file <path> --line <n> \
|
|
67
|
+
--line-type right --body "[Blocking|Suggestion|Nit] <finding>"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
(Use `--line-type left` for lines that were removed.)
|
|
71
|
+
|
|
72
|
+
## Step 6 — Approve or request changes
|
|
73
|
+
|
|
74
|
+
**If any Blocking findings were posted:**
|
|
75
|
+
Bitbucket: `pncli bitbucket needs-work --pr <id>`
|
|
76
|
+
ADO: `pncli ado repo wait-for-author --pr <id>`
|
|
77
|
+
|
|
78
|
+
**If no Blocking findings:** Ask the user: "No blocking issues found. Approve this PR? (y/n)"
|
|
79
|
+
On yes — Bitbucket: `pncli bitbucket approve --pr <id>` / ADO: `pncli ado repo approve --pr <id>`
|
|
80
|
+
On no — leave without approving.
|
|
81
|
+
|
|
82
|
+
Report: N Blocking, N Suggestion, N Nit. Overall decision.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: local-setup
|
|
3
|
+
description: Use when asked to set up pncli for the first time, configure services, or initialize a repo. Walks through identity, work item tracking, source control, and optional services using non-interactive pncli config commands.
|
|
4
|
+
compatibility: Designed for Claude Code. Requires pncli installed and accessible in PATH.
|
|
5
|
+
user-invocable: true
|
|
6
|
+
metadata:
|
|
7
|
+
category: setup
|
|
8
|
+
providers: both
|
|
9
|
+
services: config
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Walk the user through a complete pncli setup — global config and repo-level defaults — using non-interactive commands. Ask the user questions and use their answers to run `pncli config set` commands.
|
|
13
|
+
|
|
14
|
+
**Step 1 — Ask about identity.**
|
|
15
|
+
|
|
16
|
+
Ask the user:
|
|
17
|
+
- "What is your email address? (used across Jira, Bitbucket, etc.)"
|
|
18
|
+
- "What is your username or user ID?"
|
|
19
|
+
|
|
20
|
+
Then set the values:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
pncli config set user.email <their-email>
|
|
24
|
+
pncli config set user.userId <their-username>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Step 2 — Ask about work item tracking.**
|
|
28
|
+
|
|
29
|
+
Ask the user: "Does this organization use **Jira** or **Azure DevOps** for work items and tickets?"
|
|
30
|
+
|
|
31
|
+
If **Jira**:
|
|
32
|
+
- Ask for their Jira base URL (e.g. `https://jira.company.com`)
|
|
33
|
+
- Ask for their Jira personal access token
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
pncli config set jira.baseUrl <url>
|
|
37
|
+
pncli config set jira.apiToken <token>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If **Azure DevOps**:
|
|
41
|
+
- Ask for their Azure DevOps Server base URL (e.g. `https://tfs.company.com`)
|
|
42
|
+
- Ask for their ADO personal access token
|
|
43
|
+
- Ask for their default collection name (e.g. `DefaultCollection`)
|
|
44
|
+
- Ask for their default project name
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
pncli config set ado.baseUrl <url>
|
|
48
|
+
pncli config set ado.pat <token>
|
|
49
|
+
pncli config set defaults.ado.collection <collection>
|
|
50
|
+
pncli config set defaults.ado.project <project>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Step 3 — Ask about source control.**
|
|
54
|
+
|
|
55
|
+
Ask the user: "Does this organization use **Bitbucket** or **Azure DevOps** for pull requests and code review?"
|
|
56
|
+
|
|
57
|
+
If **Bitbucket**:
|
|
58
|
+
- Ask for their Bitbucket Server base URL
|
|
59
|
+
- Ask for their Bitbucket personal access token
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
pncli config set bitbucket.baseUrl <url>
|
|
63
|
+
pncli config set bitbucket.pat <token>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If **Azure DevOps** and not already configured in step 2, ask for the ADO credentials now.
|
|
67
|
+
|
|
68
|
+
**Step 4 — Ask about optional services.**
|
|
69
|
+
|
|
70
|
+
Ask the user about each of these. Skip any they don't use:
|
|
71
|
+
|
|
72
|
+
**Confluence** — "Do you use Confluence for documentation?"
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
pncli config set confluence.baseUrl <url>
|
|
76
|
+
pncli config set confluence.apiToken <token>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**SonarQube** — "Do you use SonarQube for code quality and security scanning?"
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
pncli config set sonar.baseUrl <url>
|
|
83
|
+
pncli config set sonar.token <token>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**SDElements** — "Do you use SDElements for threat modeling?" If yes, ask for their connection string (format: `token@hostname`):
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
pncli config set sde.connection <token@hostname>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Checkmarx** — "Do you use Checkmarx CxSAST for vulnerability scanning?"
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
pncli config set checkmarx.baseUrl <url>
|
|
96
|
+
pncli config set checkmarx.username <username>
|
|
97
|
+
pncli config set checkmarx.password <password>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The base URL is your CxSAST server root, e.g. `https://cx.company.com`. pncli handles the OAuth2 token exchange using your username and password — no other tools required.
|
|
101
|
+
|
|
102
|
+
**IBM UrbanCode Deploy** — "Do you use IBM UrbanCode Deploy for component imports or deployment processes?"
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
pncli config set udeploy.baseUrl <url>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Ask whether they authenticate with a PAT or username/password:
|
|
109
|
+
|
|
110
|
+
- If **PAT**: `pncli config set udeploy.pat <token>`
|
|
111
|
+
- If **username/password**:
|
|
112
|
+
```
|
|
113
|
+
pncli config set udeploy.username <username>
|
|
114
|
+
pncli config set udeploy.password <password>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Optionally set defaults to avoid repeating flags on every command:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
pncli config set defaults.udeploy.application <app-name>
|
|
121
|
+
pncli config set defaults.udeploy.environment <env-name>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Jenkins** — "Do you use Jenkins for CI/CD pipelines?"
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
pncli config set jenkins.baseUrl <url>
|
|
128
|
+
pncli config set jenkins.username <username>
|
|
129
|
+
pncli config set jenkins.apiToken <token>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The base URL is your Jenkins root, e.g. `https://jenkins.company.com`. pncli authenticates using HTTP Basic (username + API token).
|
|
133
|
+
|
|
134
|
+
**Artifactory** — "Do you use Artifactory for package management?"
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
pncli config set artifactory.baseUrl <url>
|
|
138
|
+
pncli config set artifactory.token <token>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Then ask which package ecosystems they proxy through Artifactory (npm, NuGet, Maven). Set whichever apply:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
pncli config set artifactory.npmRepo <virtual-repo-name>
|
|
145
|
+
pncli config set artifactory.nugetRepo <virtual-repo-name>
|
|
146
|
+
pncli config set artifactory.mavenRepo <virtual-repo-name>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Jenkins** — "Do you use Jenkins for CI/CD pipelines?"
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
pncli config set jenkins.baseUrl <url>
|
|
153
|
+
pncli config set jenkins.username <username>
|
|
154
|
+
pncli config set jenkins.apiToken <token>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**ServiceNow** — "Do you use ServiceNow for change management?"
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
pncli config set servicenow.baseUrl <url>
|
|
161
|
+
pncli config set servicenow.username <username>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Ask whether they authenticate with a password or API token:
|
|
165
|
+
|
|
166
|
+
- If **password**: `pncli config set servicenow.password <password>`
|
|
167
|
+
- If **API token**: `pncli config set servicenow.apiToken <token>`
|
|
168
|
+
|
|
169
|
+
The base URL is your ServiceNow instance root, e.g. `https://mycompany.service-now.com`.
|
|
170
|
+
|
|
171
|
+
**Contrast IAST** — "Do you use Contrast Security for interactive application security testing?"
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
pncli config set contrast.orgUuid <org-uuid>
|
|
175
|
+
pncli config set contrast.username <username>
|
|
176
|
+
pncli config set contrast.apiKey <api-key>
|
|
177
|
+
pncli config set contrast.serviceKey <service-key>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Optionally set the base URL if using an on-premise instance (defaults to `https://app.contrastsecurity.com`):
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
pncli config set contrast.baseUrl <url>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
All four credentials (org UUID, username, API key, service key) are found in your Contrast account under **User Settings → Your Keys**.
|
|
187
|
+
|
|
188
|
+
**Sonatype IQ Server** — "Do you use Sonatype IQ Server for dependency security policy enforcement?"
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
pncli config set sonatypeiq.baseUrl <url>
|
|
192
|
+
pncli config set sonatypeiq.userCode <user-code>
|
|
193
|
+
pncli config set sonatypeiq.passcode <passcode>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The `userCode` and `passcode` are User Token credentials generated in your IQ Server profile under **User Menu → User Token**. The base URL is your IQ Server instance root, e.g. `https://iq.your-company.com`.
|
|
197
|
+
|
|
198
|
+
Once configured, use `pncli sonatypeiq applications list` to discover application IDs, then run `pncli deps frisk --source sonatypeiq --application-id <id>` to scan dependencies against your IQ Server policies.
|
|
199
|
+
|
|
200
|
+
**Step 5 — Set repo-level defaults.**
|
|
201
|
+
|
|
202
|
+
Ask the user for project-specific defaults:
|
|
203
|
+
- "What is the default Jira project key for this repo?" (e.g. `ACME`)
|
|
204
|
+
- "What is the default target branch for PRs?" (e.g. `main`)
|
|
205
|
+
- If SonarQube is configured: "What is the SonarQube project key?"
|
|
206
|
+
- If SDElements is configured: "What is the SDElements project ID?"
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
pncli config set --repo defaults.jira.project <key>
|
|
210
|
+
pncli config set --repo defaults.bitbucket.targetBranch <branch>
|
|
211
|
+
pncli config set --repo defaults.sonar.project <key>
|
|
212
|
+
pncli config set --repo defaults.sde.project <id>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The `--repo` flag writes to `.pncli.json` in the repo root, keeping project-specific defaults scoped to the repo and shareable via version control.
|
|
216
|
+
|
|
217
|
+
**Step 6 — Test connectivity.**
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
pncli config test
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Review the results. If any service shows `ok: false`, help the user troubleshoot the URL or credentials.
|
|
224
|
+
|
|
225
|
+
Run `pncli config show` to confirm the final configuration.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Turn a feature description, goal, or problem statement into a structured backlog in Jira or ADO. Explores the codebase with parallel subagents before generating the breakdown; shows the plan to the user for confirmation before creating any work items. Use when asked to plan a feature, break down a problem, or create backlog items from a description.
|
|
4
|
+
compatibility: Designed for Claude Code. Requires pncli configured with Jira or Azure DevOps.
|
|
5
|
+
user-invocable: true
|
|
6
|
+
metadata:
|
|
7
|
+
category: planning
|
|
8
|
+
providers: both
|
|
9
|
+
services: git, jira, ado
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1 — Get the feature description
|
|
13
|
+
|
|
14
|
+
Ask the user: "What are you planning? Describe the feature, goal, or problem in as much detail as you have."
|
|
15
|
+
|
|
16
|
+
Wait for their response before proceeding.
|
|
17
|
+
|
|
18
|
+
## Step 2 — Detect ticket provider
|
|
19
|
+
|
|
20
|
+
Run `pncli config show`.
|
|
21
|
+
- `jira.baseUrl` present → Jira. Note the default project key from `defaults.jira.project`.
|
|
22
|
+
- `ado.baseUrl` present → ADO. Note the default project from `defaults.ado.project`.
|
|
23
|
+
|
|
24
|
+
## Step 3 — RESEARCH: Explore the codebase (parallel)
|
|
25
|
+
|
|
26
|
+
Launch three agents based on the feature description:
|
|
27
|
+
|
|
28
|
+
**Agent A — Relevant files and patterns**
|
|
29
|
+
Search the codebase for files related to the described feature area (grep for key terms, check likely directories).
|
|
30
|
+
Read the most relevant source files in full.
|
|
31
|
+
Note: existing patterns, data models, API contracts, naming conventions used in this area.
|
|
32
|
+
|
|
33
|
+
**Agent B — Dependencies and integration points**
|
|
34
|
+
Identify external services, APIs, or packages the feature will touch.
|
|
35
|
+
Read any relevant config files and interface/type definitions.
|
|
36
|
+
Check for existing tests that cover adjacent code — note what's already tested.
|
|
37
|
+
|
|
38
|
+
**Agent C — Scope and constraints**
|
|
39
|
+
Read `CLAUDE.md` (or any architecture decision records present).
|
|
40
|
+
Identify stable contracts or public APIs that should NOT change.
|
|
41
|
+
Note any known tech debt or open issues in the affected area that could affect scope.
|
|
42
|
+
|
|
43
|
+
Wait for all three agents.
|
|
44
|
+
|
|
45
|
+
## Step 4 — PLAN: Produce a story breakdown
|
|
46
|
+
|
|
47
|
+
Using the research output, generate a structured plan:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Epic: "<Feature name>" — one-sentence description
|
|
51
|
+
|
|
52
|
+
Story 1: <title>
|
|
53
|
+
Acceptance criteria:
|
|
54
|
+
- <testable criterion>
|
|
55
|
+
- <testable criterion>
|
|
56
|
+
Size: S / M / L
|
|
57
|
+
Depends on: (none | Story N)
|
|
58
|
+
|
|
59
|
+
Story 2: ...
|
|
60
|
+
|
|
61
|
+
Tasks under Story 1:
|
|
62
|
+
- <specific implementation step> (<file(s) that will change>)
|
|
63
|
+
- ...
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Show the complete breakdown to the user and ask:
|
|
67
|
+
"Does this plan look right? Say 'looks good' to create the work items, or describe any changes."
|
|
68
|
+
|
|
69
|
+
**Wait for explicit user confirmation before Step 5.** Do not create any tickets until confirmed.
|
|
70
|
+
|
|
71
|
+
## Step 5 — IMPLEMENT: Create work items
|
|
72
|
+
|
|
73
|
+
Only create an Epic if there are more than 2 stories.
|
|
74
|
+
|
|
75
|
+
**Jira:**
|
|
76
|
+
```
|
|
77
|
+
# Epic (if >2 stories)
|
|
78
|
+
pncli jira create-issue --project <key> --type Epic \
|
|
79
|
+
--summary "<epic title>" --description "<description>"
|
|
80
|
+
|
|
81
|
+
# Per story
|
|
82
|
+
pncli jira create-issue --project <key> --type Story \
|
|
83
|
+
--summary "<story title>" \
|
|
84
|
+
--description "<acceptance criteria>" \
|
|
85
|
+
--labels <feature-label>
|
|
86
|
+
|
|
87
|
+
# Per task
|
|
88
|
+
pncli jira create-issue --project <key> --type Task \
|
|
89
|
+
--summary "<task title>" --description "<details>"
|
|
90
|
+
|
|
91
|
+
# Link story → epic
|
|
92
|
+
pncli jira link-issue --key <story> --link-type "is child of" --target <epic>
|
|
93
|
+
|
|
94
|
+
# Link task → story
|
|
95
|
+
pncli jira link-issue --key <task> --link-type "is child of" --target <story>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**ADO:**
|
|
99
|
+
```
|
|
100
|
+
# Epic (if >2 stories)
|
|
101
|
+
pncli ado work create --type Epic --title "<epic title>" --description "<description>"
|
|
102
|
+
|
|
103
|
+
# Per story
|
|
104
|
+
pncli ado work create --type "User Story" \
|
|
105
|
+
--title "<story title>" --description "<acceptance criteria>"
|
|
106
|
+
|
|
107
|
+
# Per task
|
|
108
|
+
pncli ado work create --type Task --title "<task title>" --description "<details>"
|
|
109
|
+
|
|
110
|
+
# Link story → epic
|
|
111
|
+
pncli ado work link --id <story> --to <epic> --type parent
|
|
112
|
+
|
|
113
|
+
# Link task → story
|
|
114
|
+
pncli ado work link --id <task> --to <story> --type parent
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Step 6 — Report
|
|
118
|
+
|
|
119
|
+
Print: Epic key/id (if created), each story with its key/id, total tasks created.
|
|
120
|
+
Ask: "Want me to open the Epic in the browser?"
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-review
|
|
3
|
+
description: Scan all security sources (dependency CVEs, SonarQube vulnerabilities, SonarQube hotspots, optionally SDElements threats), triage by severity, then create Jira or ADO tickets — Bug for critical/blocking findings, Task for others, grouped under an Epic when more than 3 tickets are created. Use when asked to do a security review, scan for vulnerabilities, or triage security findings into the backlog.
|
|
4
|
+
compatibility: Designed for Claude Code. Requires pncli configured with deps scanning and optionally SonarQube and SDElements.
|
|
5
|
+
user-invocable: true
|
|
6
|
+
metadata:
|
|
7
|
+
category: security
|
|
8
|
+
providers: both
|
|
9
|
+
services: deps, sonar, sde, jira, ado
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1 — RESEARCH: Gather all findings (parallel)
|
|
13
|
+
|
|
14
|
+
Get current branch: `git rev-parse --abbrev-ref HEAD`
|
|
15
|
+
|
|
16
|
+
Launch four agents simultaneously:
|
|
17
|
+
|
|
18
|
+
**Agent A — Dependency CVEs**
|
|
19
|
+
`pncli deps frisk`
|
|
20
|
+
Report: package name, CVE id, severity (CRITICAL/HIGH/MEDIUM/LOW), fixed-in version if known.
|
|
21
|
+
|
|
22
|
+
**Agent B — SonarQube vulnerabilities**
|
|
23
|
+
`pncli sonar issues --types VULNERABILITY --statuses OPEN --branch <branch>`
|
|
24
|
+
Report: rule key, severity, file, line, message.
|
|
25
|
+
|
|
26
|
+
**Agent C — SonarQube hotspots**
|
|
27
|
+
`pncli sonar hotspots --status TO_REVIEW --branch <branch>`
|
|
28
|
+
Report: securityCategory, vulnerabilityProbability (HIGH/MEDIUM/LOW), file, line, message.
|
|
29
|
+
|
|
30
|
+
**Agent D — SDElements threats (conditional)**
|
|
31
|
+
First check: `pncli config show` — only run this agent if `sde.connection` is present in the output.
|
|
32
|
+
If present: `pncli sde threats`
|
|
33
|
+
Report: threat title, risk rating, phase (requirements/design/development/testing).
|
|
34
|
+
|
|
35
|
+
Wait for all agents.
|
|
36
|
+
|
|
37
|
+
## Step 2 — PLAN: Triage and prioritize
|
|
38
|
+
|
|
39
|
+
Consolidate all findings into a single prioritized list:
|
|
40
|
+
1. Critical CVEs + Blocker SonarQube vulnerabilities
|
|
41
|
+
2. High CVEs + Critical SonarQube vulnerabilities + High hotspots
|
|
42
|
+
3. Medium findings
|
|
43
|
+
4. Drop low/info findings unless the user explicitly requested them
|
|
44
|
+
|
|
45
|
+
**Deduplicate:** if the same file+line or the same package appears across multiple sources, merge into one finding and note all source references.
|
|
46
|
+
|
|
47
|
+
**Assign ticket type:**
|
|
48
|
+
- Critical or Blocker severity → **Bug**
|
|
49
|
+
- All others → **Task**
|
|
50
|
+
|
|
51
|
+
## Step 3 — Detect ticket provider
|
|
52
|
+
|
|
53
|
+
Run `pncli config show`.
|
|
54
|
+
- `jira.baseUrl` present → Jira
|
|
55
|
+
- `ado.baseUrl` present → ADO
|
|
56
|
+
|
|
57
|
+
## Step 4 — IMPLEMENT: Create tickets (highest severity first)
|
|
58
|
+
|
|
59
|
+
**Jira:**
|
|
60
|
+
```
|
|
61
|
+
pncli jira create-issue \
|
|
62
|
+
--project <default-project-key> \
|
|
63
|
+
--type <Bug|Task> \
|
|
64
|
+
--summary "Security: <description>" \
|
|
65
|
+
--description "<source>: <severity>\nRule/CVE: <id>\nFile: <path>:<line>\nFix: <guidance>" \
|
|
66
|
+
--priority <Critical|High|Medium> \
|
|
67
|
+
--labels security,<source-tag>
|
|
68
|
+
```
|
|
69
|
+
Source tags: `cve-remediation`, `sonar-vulnerability`, `sonar-hotspot`, `threat-model`
|
|
70
|
+
|
|
71
|
+
**ADO:**
|
|
72
|
+
```
|
|
73
|
+
pncli ado work create \
|
|
74
|
+
--type <Bug|Task> \
|
|
75
|
+
--title "Security: <description>" \
|
|
76
|
+
--description "<details>" \
|
|
77
|
+
--priority <1|2|3>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Link related findings (same component or same CVE chain):
|
|
81
|
+
- Jira: `pncli jira link-issue --key <new> --link-type "relates to" --target <related>`
|
|
82
|
+
- ADO: `pncli ado work link --id <new> --to <related> --type related`
|
|
83
|
+
|
|
84
|
+
## Step 5 — Group under Epic if more than 3 tickets
|
|
85
|
+
|
|
86
|
+
**Jira:**
|
|
87
|
+
```
|
|
88
|
+
pncli jira create-issue --project <key> --type Epic \
|
|
89
|
+
--summary "Security Review <YYYY-MM-DD>" \
|
|
90
|
+
--description "Critical: <n>, High: <n>, Medium: <n>. Sources: <list>"
|
|
91
|
+
```
|
|
92
|
+
Then for each ticket: `pncli jira link-issue --key <ticket> --link-type "is child of" --target <epic>`
|
|
93
|
+
|
|
94
|
+
**ADO:**
|
|
95
|
+
```
|
|
96
|
+
pncli ado work create --type Epic \
|
|
97
|
+
--title "Security Review <YYYY-MM-DD>" \
|
|
98
|
+
--description "<breakdown>"
|
|
99
|
+
```
|
|
100
|
+
Then: `pncli ado work link --id <ticket> --to <epic> --type parent`
|
|
101
|
+
|
|
102
|
+
## Step 6 — Report summary
|
|
103
|
+
|
|
104
|
+
Print:
|
|
105
|
+
- Sources scanned
|
|
106
|
+
- Total raw findings, deduplicated count
|
|
107
|
+
- Tickets created (with keys/ids)
|
|
108
|
+
- Epic key/id if created
|