chief-clancy 0.5.4 → 0.5.6
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/README.md +3 -3
- package/dist/bundle/clancy-once.js +54 -29
- package/dist/installer/install.js +1 -1
- package/dist/installer/install.js.map +1 -1
- package/dist/schemas/bitbucket-pr.d.ts +122 -0
- package/dist/schemas/bitbucket-pr.d.ts.map +1 -0
- package/dist/schemas/bitbucket-pr.js +69 -0
- package/dist/schemas/bitbucket-pr.js.map +1 -0
- package/dist/schemas/env.d.ts +12 -0
- package/dist/schemas/env.d.ts.map +1 -1
- package/dist/schemas/env.js +4 -0
- package/dist/schemas/env.js.map +1 -1
- package/dist/schemas/github.d.ts +60 -0
- package/dist/schemas/github.d.ts.map +1 -1
- package/dist/schemas/github.js +32 -0
- package/dist/schemas/github.js.map +1 -1
- package/dist/schemas/gitlab-mr.d.ts +62 -0
- package/dist/schemas/gitlab-mr.d.ts.map +1 -0
- package/dist/schemas/gitlab-mr.js +31 -0
- package/dist/schemas/gitlab-mr.js.map +1 -0
- package/dist/scripts/once/once.d.ts.map +1 -1
- package/dist/scripts/once/once.js +181 -23
- package/dist/scripts/once/once.js.map +1 -1
- package/dist/scripts/shared/git-ops/git-ops.d.ts +9 -0
- package/dist/scripts/shared/git-ops/git-ops.d.ts.map +1 -1
- package/dist/scripts/shared/git-ops/git-ops.js +20 -0
- package/dist/scripts/shared/git-ops/git-ops.js.map +1 -1
- package/dist/scripts/shared/progress/progress.d.ts +41 -0
- package/dist/scripts/shared/progress/progress.d.ts.map +1 -1
- package/dist/scripts/shared/progress/progress.js +96 -1
- package/dist/scripts/shared/progress/progress.js.map +1 -1
- package/dist/scripts/shared/prompt/prompt.d.ts +27 -0
- package/dist/scripts/shared/prompt/prompt.d.ts.map +1 -1
- package/dist/scripts/shared/prompt/prompt.js +32 -7
- package/dist/scripts/shared/prompt/prompt.js.map +1 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts +41 -9
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js +182 -0
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js.map +1 -1
- package/dist/scripts/shared/pull-request/github/github.d.ts +34 -1
- package/dist/scripts/shared/pull-request/github/github.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/github/github.js +106 -2
- package/dist/scripts/shared/pull-request/github/github.js.map +1 -1
- package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts +32 -9
- package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/gitlab/gitlab.js +127 -0
- package/dist/scripts/shared/pull-request/gitlab/gitlab.js.map +1 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts.map +1 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.js +7 -0
- package/dist/scripts/shared/pull-request/pr-body/pr-body.js.map +1 -1
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts +23 -0
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts.map +1 -0
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js +30 -0
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/remote.d.ts +9 -0
- package/dist/types/remote.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/roles/planner/commands/approve-plan.md +7 -0
- package/src/roles/planner/commands/plan.md +11 -1
- package/src/roles/planner/workflows/approve-plan.md +478 -0
- package/src/roles/planner/workflows/plan.md +171 -49
- package/src/roles/reviewer/workflows/logs.md +7 -3
- package/src/roles/setup/commands/help.md +3 -2
- package/src/roles/setup/workflows/init.md +68 -2
- package/src/roles/setup/workflows/scaffold.md +41 -0
- package/src/roles/setup/workflows/settings.md +41 -6
- package/src/templates/CLAUDE.md +2 -0
- package/src/roles/planner/commands/approve.md +0 -7
- package/src/roles/planner/workflows/approve.md +0 -237
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitLab merge request creation and review state checking.
|
|
3
|
+
*
|
|
4
|
+
* Uses the GitLab REST API v4 to create merge requests, check review state,
|
|
5
|
+
* and fetch review comments.
|
|
6
|
+
* Supports both gitlab.com and self-hosted instances.
|
|
7
|
+
*
|
|
8
|
+
* Auth: `PRIVATE-TOKEN` header (personal access token with `api` scope).
|
|
9
|
+
*/
|
|
10
|
+
import { gitlabDiscussionsSchema, gitlabMrListSchema, } from '../../../../schemas/gitlab-mr.js';
|
|
1
11
|
import { postPullRequest } from '../post-pr/post-pr.js';
|
|
12
|
+
import { extractReworkContent, isReworkComment, } from '../rework-comment/rework-comment.js';
|
|
2
13
|
/**
|
|
3
14
|
* Create a merge request on GitLab.
|
|
4
15
|
*
|
|
@@ -24,4 +35,120 @@ export async function createMergeRequest(token, apiBase, projectPath, sourceBran
|
|
|
24
35
|
return { url: data.web_url ?? '', number: data.iid ?? 0 };
|
|
25
36
|
}, (status, text) => status === 409 && text.includes('already exists'));
|
|
26
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Check the review state of an open MR for a given branch.
|
|
40
|
+
*
|
|
41
|
+
* Finds the open MR matching the source branch, fetches all discussions.
|
|
42
|
+
* Inline notes (type `DiffNote`) always trigger rework. General conversation
|
|
43
|
+
* notes only trigger rework when prefixed with `Rework:`.
|
|
44
|
+
*
|
|
45
|
+
* @param token - The GitLab personal access token.
|
|
46
|
+
* @param apiBase - The API base URL (e.g. `https://gitlab.com/api/v4`).
|
|
47
|
+
* @param projectPath - The raw project path (e.g. `group/subgroup/project`). URL-encoded internally.
|
|
48
|
+
* @param branch - The source branch to look up.
|
|
49
|
+
* @param since - ISO 8601 timestamp; only notes created after this time trigger rework.
|
|
50
|
+
* @returns The review state if an open MR exists, otherwise `undefined`.
|
|
51
|
+
*/
|
|
52
|
+
export async function checkMrReviewState(token, apiBase, projectPath, branch, since) {
|
|
53
|
+
try {
|
|
54
|
+
const encodedPath = encodeURIComponent(projectPath);
|
|
55
|
+
const mrUrl = `${apiBase}/projects/${encodedPath}/merge_requests?source_branch=${branch}&state=opened`;
|
|
56
|
+
const mrRes = await fetch(mrUrl, {
|
|
57
|
+
headers: { 'PRIVATE-TOKEN': token },
|
|
58
|
+
});
|
|
59
|
+
if (!mrRes.ok)
|
|
60
|
+
return undefined;
|
|
61
|
+
const data = gitlabMrListSchema.parse(await mrRes.json());
|
|
62
|
+
if (data.length === 0)
|
|
63
|
+
return undefined;
|
|
64
|
+
const mr = data[0];
|
|
65
|
+
const discussionsUrl = `${apiBase}/projects/${encodedPath}/merge_requests/${mr.iid}/discussions?per_page=100`;
|
|
66
|
+
const discussionsRes = await fetch(discussionsUrl, {
|
|
67
|
+
headers: { 'PRIVATE-TOKEN': token },
|
|
68
|
+
});
|
|
69
|
+
if (!discussionsRes.ok)
|
|
70
|
+
return undefined;
|
|
71
|
+
const discussions = gitlabDiscussionsSchema.parse(await discussionsRes.json());
|
|
72
|
+
let hasRework = false;
|
|
73
|
+
for (const discussion of discussions) {
|
|
74
|
+
for (const note of discussion.notes) {
|
|
75
|
+
if (note.system)
|
|
76
|
+
continue;
|
|
77
|
+
if (since && note.created_at && note.created_at <= since)
|
|
78
|
+
continue;
|
|
79
|
+
if (note.type === 'DiffNote' &&
|
|
80
|
+
note.resolvable !== false &&
|
|
81
|
+
note.resolved !== true) {
|
|
82
|
+
hasRework = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (isReworkComment(note.body)) {
|
|
86
|
+
hasRework = true;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (hasRework)
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
changesRequested: hasRework,
|
|
95
|
+
prNumber: mr.iid,
|
|
96
|
+
prUrl: mr.web_url,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Fetch feedback comments from an MR's discussions.
|
|
105
|
+
*
|
|
106
|
+
* Inline notes (type `DiffNote`) are always included — they inherently
|
|
107
|
+
* represent change requests. General conversation notes are only included
|
|
108
|
+
* when they start with `Rework:` (case-insensitive), with the prefix
|
|
109
|
+
* stripped. Inline notes are prefixed with `[new_path]` when available.
|
|
110
|
+
*
|
|
111
|
+
* @param token - The GitLab personal access token.
|
|
112
|
+
* @param apiBase - The API base URL (e.g. `https://gitlab.com/api/v4`).
|
|
113
|
+
* @param projectPath - The raw project path. URL-encoded internally.
|
|
114
|
+
* @param mrIid - The MR internal ID (iid).
|
|
115
|
+
* @param since - ISO 8601 timestamp; only notes created after this time are returned.
|
|
116
|
+
* @returns An array of feedback descriptions.
|
|
117
|
+
*/
|
|
118
|
+
export async function fetchMrReviewComments(token, apiBase, projectPath, mrIid, since) {
|
|
119
|
+
try {
|
|
120
|
+
const encodedPath = encodeURIComponent(projectPath);
|
|
121
|
+
const url = `${apiBase}/projects/${encodedPath}/merge_requests/${mrIid}/discussions?per_page=100`;
|
|
122
|
+
const res = await fetch(url, {
|
|
123
|
+
headers: { 'PRIVATE-TOKEN': token },
|
|
124
|
+
});
|
|
125
|
+
if (!res.ok)
|
|
126
|
+
return [];
|
|
127
|
+
const discussions = gitlabDiscussionsSchema.parse(await res.json());
|
|
128
|
+
const comments = [];
|
|
129
|
+
for (const discussion of discussions) {
|
|
130
|
+
for (const note of discussion.notes) {
|
|
131
|
+
if (note.system)
|
|
132
|
+
continue;
|
|
133
|
+
if (since && note.created_at && note.created_at <= since)
|
|
134
|
+
continue;
|
|
135
|
+
if (note.type === 'DiffNote' &&
|
|
136
|
+
note.resolvable !== false &&
|
|
137
|
+
note.resolved !== true) {
|
|
138
|
+
const prefix = note.position?.new_path
|
|
139
|
+
? `[${note.position.new_path}] `
|
|
140
|
+
: '';
|
|
141
|
+
comments.push(`${prefix}${note.body}`);
|
|
142
|
+
}
|
|
143
|
+
else if (isReworkComment(note.body)) {
|
|
144
|
+
comments.push(extractReworkContent(note.body));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return comments;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
27
154
|
//# sourceMappingURL=gitlab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/gitlab/gitlab.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/gitlab/gitlab.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAa,EACb,OAAe,EACf,WAAmB,EACnB,YAAoB,EACpB,YAAoB,EACpB,KAAa,EACb,WAAmB;IAEnB,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAEpD,OAAO,eAAe,CACpB,GAAG,OAAO,aAAa,WAAW,iBAAiB,EACnD,EAAE,eAAe,EAAE,KAAK,EAAE,EAC1B;QACE,aAAa,EAAE,YAAY;QAC3B,aAAa,EAAE,YAAY;QAC3B,KAAK;QACL,WAAW;QACX,oBAAoB,EAAE,IAAI;KAC3B,EACD,CAAC,IAAI,EAAE,EAAE;QACP,MAAM,IAAI,GAAG,IAA0C,CAAC;QACxD,OAAO,EAAE,GAAG,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ripts/shared/pull-request/pr-body/pr-body.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"pr-body.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/pr-body/pr-body.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA2CvE"}
|
|
@@ -30,6 +30,13 @@ export function buildPrBody(config, ticket) {
|
|
|
30
30
|
}
|
|
31
31
|
lines.push('---');
|
|
32
32
|
lines.push('*Created by [Clancy](https://github.com/Pushedskydiver/clancy)*');
|
|
33
|
+
lines.push('');
|
|
34
|
+
lines.push('---');
|
|
35
|
+
lines.push('**Rework instructions:** To request changes:');
|
|
36
|
+
lines.push('- **Code comments** — leave inline comments on specific lines. These are always picked up automatically.');
|
|
37
|
+
lines.push('- **General feedback** — reply with a comment starting with `Rework:` followed by what needs fixing. Comments without the `Rework:` prefix are treated as discussion.');
|
|
38
|
+
lines.push('');
|
|
39
|
+
lines.push("Example: `Rework: The form validation doesn't handle empty passwords`");
|
|
33
40
|
return lines.join('\n');
|
|
34
41
|
}
|
|
35
42
|
//# sourceMappingURL=pr-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-body.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/pr-body/pr-body.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,MAAmB,EAAE,MAAc;IAC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YACT,KAAK,CAAC,IAAI,CACR,cAAc,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,aAAa,WAAW,MAAM,CAAC,GAAG,GAAG,CAC9E,CAAC;YACF,MAAM;QACR,KAAK,QAAQ;YACX,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACxC,MAAM;IACV,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAC9E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CACR,0GAA0G,CAC3G,CAAC;IACF,KAAK,CAAC,IAAI,CACR,uKAAuK,CACxK,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,uEAAuE,CACxE,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rework comment detection and extraction utilities.
|
|
3
|
+
*
|
|
4
|
+
* Comments starting with "Rework:" (case-insensitive) are treated as
|
|
5
|
+
* rework requests. All other comments are treated as discussion and ignored.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check if a comment is a rework request (starts with "Rework:" case-insensitive).
|
|
9
|
+
*
|
|
10
|
+
* @param body - The comment body to check.
|
|
11
|
+
* @returns `true` if the comment starts with "Rework:".
|
|
12
|
+
*/
|
|
13
|
+
export declare function isReworkComment(body: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Extract the rework description from a "Rework: ..." comment.
|
|
16
|
+
*
|
|
17
|
+
* Strips the "Rework:" prefix and returns the remaining content trimmed.
|
|
18
|
+
*
|
|
19
|
+
* @param body - The full comment body starting with "Rework:".
|
|
20
|
+
* @returns The description after the prefix.
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractReworkContent(body: string): string;
|
|
23
|
+
//# sourceMappingURL=rework-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rework-comment.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/rework-comment/rework-comment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKzD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rework comment detection and extraction utilities.
|
|
3
|
+
*
|
|
4
|
+
* Comments starting with "Rework:" (case-insensitive) are treated as
|
|
5
|
+
* rework requests. All other comments are treated as discussion and ignored.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check if a comment is a rework request (starts with "Rework:" case-insensitive).
|
|
9
|
+
*
|
|
10
|
+
* @param body - The comment body to check.
|
|
11
|
+
* @returns `true` if the comment starts with "Rework:".
|
|
12
|
+
*/
|
|
13
|
+
export function isReworkComment(body) {
|
|
14
|
+
return body.trim().toLowerCase().startsWith('rework:');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract the rework description from a "Rework: ..." comment.
|
|
18
|
+
*
|
|
19
|
+
* Strips the "Rework:" prefix and returns the remaining content trimmed.
|
|
20
|
+
*
|
|
21
|
+
* @param body - The full comment body starting with "Rework:".
|
|
22
|
+
* @returns The description after the prefix.
|
|
23
|
+
*/
|
|
24
|
+
export function extractReworkContent(body) {
|
|
25
|
+
return body
|
|
26
|
+
.trim()
|
|
27
|
+
.replace(/^rework:\s*/i, '')
|
|
28
|
+
.trim();
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=rework-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rework-comment.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/rework-comment/rework-comment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,IAAI;SACR,IAAI,EAAE;SACN,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { BoardProvider, Ticket } from './board.js';
|
|
2
|
-
export type { GitPlatform, PrCreationResult, ProgressStatus, RemoteInfo, } from './remote.js';
|
|
2
|
+
export type { GitPlatform, PrCreationResult, PrReviewState, ProgressStatus, RemoteInfo, } from './remote.js';
|
|
3
3
|
export type { BoardConfig, GitHubEnv, JiraEnv, LinearEnv, SharedEnv, } from '../schemas/env.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC"}
|
package/dist/types/remote.d.ts
CHANGED
|
@@ -39,6 +39,15 @@ export type PrCreationResult = {
|
|
|
39
39
|
error: string;
|
|
40
40
|
alreadyExists?: boolean;
|
|
41
41
|
};
|
|
42
|
+
/** Result of checking PR/MR review state. */
|
|
43
|
+
export type PrReviewState = {
|
|
44
|
+
/** Whether changes have been requested by a reviewer. */
|
|
45
|
+
changesRequested: boolean;
|
|
46
|
+
/** The PR/MR number/ID (needed to fetch comments). */
|
|
47
|
+
prNumber: number;
|
|
48
|
+
/** The PR/MR URL (for logging). */
|
|
49
|
+
prUrl: string;
|
|
50
|
+
};
|
|
42
51
|
/** Progress log status values. */
|
|
43
52
|
export type ProgressStatus = 'DONE' | 'SKIPPED' | 'PR_CREATED' | 'PUSHED' | 'PUSH_FAILED' | 'LOCAL' | 'PLAN' | 'APPROVE' | 'REWORK';
|
|
44
53
|
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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AAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,kCAAkC;AAClC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,aAAa,GACb,OAAO,GACP,MAAM,GACN,SAAS,GACT,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# /clancy:approve-plan
|
|
2
|
+
|
|
3
|
+
Promote an approved Clancy plan to the ticket description. Accepts an optional ticket key argument (e.g. `/clancy:approve-plan PROJ-123`). When no key is provided, auto-selects the oldest planned-but-unapproved ticket.
|
|
4
|
+
|
|
5
|
+
@.claude/clancy/workflows/approve-plan.md
|
|
6
|
+
|
|
7
|
+
Follow the approve-plan workflow above. Fetch the plan comment, confirm with the user, append it to the ticket description, and transition the ticket to the implementation queue.
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Fetch backlog tickets from the board, explore the codebase, and generate structured implementation plans. Plans are posted as comments on the ticket for human review.
|
|
4
4
|
|
|
5
|
-
Accepts
|
|
5
|
+
Accepts optional arguments:
|
|
6
|
+
- **Batch mode:** `/clancy:plan 3` — plan up to 3 tickets from the queue
|
|
7
|
+
- **Specific ticket:** `/clancy:plan PROJ-123`, `/clancy:plan #42`, `/clancy:plan ENG-42` — plan a single ticket by key
|
|
8
|
+
- **Fresh start:** `--fresh` — discard any existing plan and start over
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
- `/clancy:plan` — plan 1 ticket from queue
|
|
12
|
+
- `/clancy:plan 3` — plan 3 tickets from queue
|
|
13
|
+
- `/clancy:plan PROJ-123` — plan a specific Jira/Linear ticket
|
|
14
|
+
- `/clancy:plan #42` — plan a specific GitHub issue
|
|
15
|
+
- `/clancy:plan --fresh PROJ-123` — discard existing plan and start over
|
|
6
16
|
|
|
7
17
|
@.claude/clancy/workflows/plan.md
|
|
8
18
|
|