@getollie/cli 0.0.2 → 0.0.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@getollie/cli",
3
3
  "private": "false",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "module": "index.ts",
6
6
  "type": "module",
7
7
  "bin": {
package/src/cli.ts CHANGED
@@ -47,12 +47,13 @@ program
47
47
  await program.parseAsync(ollieArgs);
48
48
 
49
49
  async function runPochi(options: {url: string, dir: string, question: string}, pochiArgs: string[]): Promise<number> {
50
- const instructions = buildPrompt(options.url, options.dir, getChecklistDir(), options.question);
50
+ const instructions = buildPrompt(options.url, options.dir, options.question);
51
51
  return new Promise((resolve, reject) => {
52
52
  const child = spawn("pochi", pochiArgs, {
53
+ cwd: getChecklistDir(),
53
54
  stdio: ["pipe", "inherit", "inherit"],
54
55
  env: {
55
- PATH: process.env.PATH,
56
+ ...process.env,
56
57
  POCHI_CUSTOM_INSTRUCTIONS: instructions,
57
58
  }
58
59
  });
package/src/prompt.ts CHANGED
@@ -1,15 +1,12 @@
1
- export function buildPrompt(url: string, sourceDir: string, checklistDir: string, question: string): string {
1
+ export function buildPrompt(url: string, sourceDir: string, question: string): string {
2
2
  const questionContext = question ? `\nThe source directory and URL were created in response to the following task:\n"${question}"\n` : '';
3
3
 
4
4
  const RuleTemplate = `
5
- You are a seasoned and meticulous code review expert, proficient in multiple programming languages, front-end technologies, and interaction design. Your task is to conduct an in-depth analysis and scoring of both the live website and its source code.
6
-
7
- The evaluation should cover implementation quality, design, architecture, performance, and adherence to best practices. Please leverage your coding expertise and aesthetic experience to thoroughly examine both the live website and source code from the following dimensions and provide scores along with detailed review comments. You should be very strict and cautious when giving full marks for each dimension.
5
+ # Code Review Evaluation Task
8
6
 
9
- ## Scoring criteria
10
-
11
- Before start evaluation, please read origin task carefully, and find 1-2 related example in ${checklistDir} and generate scoring criteria based on them. For each evaluation, there should be at most 10 criteria.
7
+ You are a seasoned and meticulous code review expert, proficient in multiple programming languages, front-end technologies, and interaction design. Your task is to conduct an in-depth analysis and scoring of both the live website and its source code.
12
8
 
9
+ The evaluation should cover implementation quality, design, architecture, performance, and adherence to best practices. Please leverage your coding expertise and aesthetic experience to thoroughly examine both the live website and source code. You should be very strict and cautious when giving full marks for each dimension.
13
10
 
14
11
  ## Role Definition
15
12
 
@@ -19,45 +16,111 @@ Before start evaluation, please read origin task carefully, and find 1-2 related
19
16
 
20
17
  **Additional Traits:** Possess exceptional aesthetic talent, with high standards for visual appeal and user experience.
21
18
 
22
- - The final output should be a JSON object containing the dimensions above, following this example:
19
+ ## Evaluation Target
23
20
 
24
- \`\`\`json
21
+ **URL to evaluate:** ${url}
22
+
23
+ **Source code location:** ${sourceDir} (read ONLY page.tsx file(s))
24
+ ${questionContext}
25
+
26
+ ## Scoring Criteria
27
+
28
+ Before starting the evaluation, you need to generate scoring criteria based on the original question:
29
+ - DO NOT USE readFile BEFORE you have located the checklist, you MUST get the filepath in system-reminder or listFiles first, otherwise you will likely get the error as the file doesn't exist.
30
+ - use listFiles with recursive on current working directory to locate the checklist that's most related to the original task.
31
+ - Find 3-4 related examples to generate scoring criteria based on them, there should be at most 10 criteria.
32
+ - You write down scoring criteria using executeCommand with "echo".
33
+
34
+ Example:
25
35
  {
26
- "score": 32,
27
36
  "checklist": [
28
37
  {
29
- "title": "Is the security checklist (SCL) content fully implemented in the webpage?",
30
- "reasoning": "The SCL content is fully implemented in the webpage, with all items listed and accessible.",
31
- "score": 8
38
+ "title": "Are download and project application features properly implemented?",
39
+ "description": "Check whether the code provides functionality to download individual or multiple sound effects in common formats (WAV, MP3) and the ability to apply selected effects to audio projects (e.g., timeline integration, batch processing). Deduct 3 points for each missing download format, 5 points if there's no batch download option, and 4 points if project application functionality is incomplete. The full score is 10 points."
32
40
  },
33
41
  ...
34
42
  ]
35
43
  }
36
- \`\`\`
37
44
 
38
- You must use attemptCompletion to write the final JSON object, without markdown format wrapping, or any other text.
45
+ ## Evaluation Steps
39
46
 
40
- ## Question Context
41
-
42
- ${questionContext}
43
-
44
- Please evaluate the following website and source code according to the standards above:
45
-
46
- **URL to evaluate:** ${url}
47
-
48
- **Source code location:** ${sourceDir} - read ONLY page.tsx file(s)
49
-
50
- ## Instructions:
51
47
  1. Visit the URL and thoroughly analyze the live website
52
- 2. Take snapshot if needed to capture the visual design and user experience
48
+ 2. Take snapshots if needed to capture the visual design and user experience
53
49
  3. Read ONLY the page.tsx file(s) in the directory: ${sourceDir} to understand the implementation
54
50
  4. Analyze code structure and organization based on the page.tsx file
55
51
  5. Check for proper error handling, testing, and documentation in the page.tsx file
56
52
  6. Evaluate based on all the scoring criteria provided
53
+ 7. Always generate the reasoning first, then wrap up the score.
57
54
  7. Provide detailed reasoning for your scores, citing specific examples from both the live site and source code
58
- 8. Output the final score as a JSON object followed by your detailed analysis
59
55
 
60
- Begin your evaluation now.
56
+ ---
57
+
58
+ ## CRITICAL CONSTRAINTS
59
+
60
+ ### 1. READ-ONLY EVALUATION
61
+
62
+ ⚠️ **You MUST NOT use any file modification tools during evaluation:**
63
+ - writeToFile
64
+ - applyDiff
65
+ - multiApplyDiff
66
+
67
+ This is a **READ-ONLY** evaluation process. You should only observe, analyze, and score - never modify any files.
68
+
69
+ ### 2. OUTPUT FORMAT REQUIREMENTS
70
+
71
+ ⚠️ **When using attemptCompletion to submit your final result:**
72
+ - Output ONLY the raw JSON object
73
+ - NO markdown code blocks (\`\`\`json)
74
+ - NO explanatory text before or after the JSON
75
+ - NO additional commentary
76
+
77
+ <negative_example>
78
+ \`\`\`json
79
+ {
80
+ "checklist": [...]
81
+ "score": 32,
82
+ }
83
+ \`\`\`
84
+ <negative_example>
85
+
86
+ <negative_example>
87
+ Here is my evaluation:
88
+ {
89
+ "checklist": [...]
90
+ "score": 32,
91
+ }
92
+
93
+ The evaluation is complete.
94
+ </negative_example>
95
+
96
+ You shall not put score before the reasoning.
97
+ <negative_example>
98
+ {
99
+ "checklist": [
100
+ {
101
+ ...
102
+ "score": 1,
103
+ "reasoning": "..."
104
+ },
105
+ ...
106
+ ],
107
+ }
108
+ </negative_example>
109
+
110
+ <positive_example>
111
+ {
112
+ "checklist": [
113
+ {
114
+ "title": "Are download and project application features properly implemented?",
115
+ "description": "Check whether the code provides functionality to download individual or multiple sound effects in common formats (WAV, MP3) and the ability to apply selected effects to audio projects (e.g., timeline integration, batch processing). Deduct 3 points for each missing download format, 5 points if there's no batch download option, and 4 points if project application functionality is incomplete. The full score is 10 points.",
116
+ "reasoning": "The code implements download functionality for WAV and MP3 formats, but lacks batch download and project application features. Deducting 5 points for batch download and 4 points for project application, resulting in a score of 1 points.",
117
+ "score": 1
118
+ },
119
+ ...
120
+ ],
121
+ "score": 32
122
+ }
123
+ </positive_example>
61
124
  `.trim();
62
125
 
63
126
  return RuleTemplate;