santree 0.0.9 → 0.0.10
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/dist/commands/work.js
CHANGED
|
@@ -4,21 +4,22 @@ import { Text, Box } from "ink";
|
|
|
4
4
|
import Spinner from "ink-spinner";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { spawn } from "child_process";
|
|
7
|
-
import { readFileSync } from "fs";
|
|
8
7
|
import { fileURLToPath } from "url";
|
|
9
8
|
import { dirname, join } from "path";
|
|
9
|
+
import nunjucks from "nunjucks";
|
|
10
10
|
import { getCurrentBranch, extractTicketId, findRepoRoot } from "../lib/git.js";
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = dirname(__filename);
|
|
13
|
+
const promptsDir = join(__dirname, "..", "..", "prompts");
|
|
14
|
+
nunjucks.configure(promptsDir, { autoescape: false });
|
|
13
15
|
export const description = "Launch Claude to work on current ticket";
|
|
14
16
|
export const options = z.object({
|
|
15
17
|
plan: z.boolean().optional().describe("Only create implementation plan"),
|
|
16
18
|
review: z.boolean().optional().describe("Review changes against ticket"),
|
|
17
19
|
"fix-pr": z.boolean().optional().describe("Fetch PR comments and fix them"),
|
|
18
20
|
});
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
return readFileSync(join(promptsDir, `${mode}.txt`), "utf-8");
|
|
21
|
+
function renderPrompt(mode, context) {
|
|
22
|
+
return nunjucks.render(`${mode}.njk`, context);
|
|
22
23
|
}
|
|
23
24
|
function getMode(opts) {
|
|
24
25
|
if (opts["fix-pr"])
|
|
@@ -92,8 +93,7 @@ export default function Work({ options }) {
|
|
|
92
93
|
if (status !== "ready" || !ticketId)
|
|
93
94
|
return;
|
|
94
95
|
setStatus("launching");
|
|
95
|
-
const
|
|
96
|
-
const prompt = template.replace(/\{\{ticket_id\}\}/g, ticketId);
|
|
96
|
+
const prompt = renderPrompt(mode, { ticket_id: ticketId });
|
|
97
97
|
const happyCmd = "happy";
|
|
98
98
|
// Build args array
|
|
99
99
|
const args = [];
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Fetch Linear ticket {{ ticket_id }} using MCP (including issue comments) to understand the original requirements.
|
|
2
|
+
|
|
3
|
+
Use `gh` CLI to fetch the latest PR comments and review feedback for the current branch.
|
|
4
|
+
{% if pr_comments %}
|
|
5
|
+
## PR Comments to Address
|
|
6
|
+
|
|
7
|
+
{{ pr_comments }}
|
|
8
|
+
{% endif %}
|
|
9
|
+
## Task
|
|
10
|
+
|
|
11
|
+
1. Review each PR comment and understand what changes are requested
|
|
12
|
+
2. Make the necessary code changes to address each comment
|
|
13
|
+
3. Ensure the changes align with the original ticket requirements
|
|
14
|
+
4. Run tests if applicable to verify the fixes
|
|
15
|
+
|
|
16
|
+
Address all comments systematically, starting from the most critical ones.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Fetch Linear ticket {{ticket_id}} using MCP (including issue comments) and analyze what needs to be done.
|
|
1
|
+
Fetch Linear ticket {{ ticket_id }} using MCP (including issue comments) and analyze what needs to be done.
|
|
2
2
|
|
|
3
3
|
If a PR URL is linked in the ticket, use `gh` CLI to fetch PR details, comments, and review feedback.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Fetch Linear ticket {{ticket_id}} using MCP (including issue comments) and analyze what needs to be done.
|
|
1
|
+
Fetch Linear ticket {{ ticket_id }} using MCP (including issue comments) and analyze what needs to be done.
|
|
2
2
|
|
|
3
3
|
If a PR URL is linked in the ticket, use `gh` CLI to fetch PR details, comments, and review feedback for additional context.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Fetch Linear ticket {{ticket_id}} using MCP (including issue comments) to understand the requirements and acceptance criteria.
|
|
1
|
+
Fetch Linear ticket {{ ticket_id }} using MCP (including issue comments) to understand the requirements and acceptance criteria.
|
|
2
2
|
|
|
3
3
|
If a PR URL is linked in the ticket, use `gh` CLI to fetch PR details and any existing review comments.
|
|
4
4
|
|
package/prompts/fix-pr.txt
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Fetch Linear ticket {{ticket_id}} using MCP (including issue comments) to understand the original requirements.
|
|
2
|
-
|
|
3
|
-
If a PR URL is linked in the ticket, use `gh` CLI to fetch the latest PR comments and review feedback.
|
|
4
|
-
|
|
5
|
-
## PR Comments to Address
|
|
6
|
-
|
|
7
|
-
{{pr_comments}}
|
|
8
|
-
|
|
9
|
-
## Task
|
|
10
|
-
|
|
11
|
-
1. Review each comment and understand what changes are requested
|
|
12
|
-
2. Make the necessary code changes to address each comment
|
|
13
|
-
3. Ensure the changes align with the original ticket requirements
|
|
14
|
-
4. Run tests if applicable to verify the fixes
|
|
15
|
-
|
|
16
|
-
Address all comments systematically, starting from the most critical ones.
|