agentv 0.17.0 → 0.18.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/dist/{chunk-KL3Y2C6J.js → chunk-PHILDJ3W.js} +3 -3
- package/dist/chunk-PHILDJ3W.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/.claude/skills/agentv-prompt-optimizer/SKILL.md +35 -27
- package/package.json +5 -2
- package/dist/chunk-KL3Y2C6J.js.map +0 -1
package/dist/cli.js
CHANGED
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { runCli } from \"./index.js\";\n\nvoid runCli();\n"],"mappings":";;;;;;;AAGA,KAAK,OAAO;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\r\nimport { runCli } from \"./index.js\";\r\n\r\nvoid runCli();\r\n"],"mappings":";;;;;;;AAGA,KAAK,OAAO;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -21,41 +21,48 @@ description: Iteratively optimize prompt files against AgentV evaluation dataset
|
|
|
21
21
|
- If not, create a new one in the parent directory of the eval files: `optimization-[timestamp].md`.
|
|
22
22
|
- Read content of the identified prompt file.
|
|
23
23
|
|
|
24
|
-
2. **Optimization Loop** (Max
|
|
25
|
-
- **Execute (The Generator)**: Run `
|
|
24
|
+
2. **Optimization Loop** (Max 10 iterations)
|
|
25
|
+
- **Execute (The Generator)**: Run `agentv eval <eval-path>`.
|
|
26
|
+
- *Targeted Run*: If iterating on specific stubborn failures, use `--eval-id <case_id>` to run only the relevant eval cases.
|
|
26
27
|
- **Analyze (The Reflector)**:
|
|
27
28
|
- Locate the results file path from the console output (e.g., `.agentv/results/eval_...jsonl`).
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
- **
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
- **Orchestrate Subagent**: Use `runSubagent` to analyze the results.
|
|
30
|
+
- **Task**: Read the results file, calculate pass rate, and perform root cause analysis.
|
|
31
|
+
- **Output**: Return a structured analysis including:
|
|
32
|
+
- **Score**: Current pass rate.
|
|
33
|
+
- **Root Cause**: Why failures occurred (e.g., "Ambiguous definition", "Hallucination").
|
|
34
|
+
- **Insight**: Key learning or pattern identified from the failures.
|
|
35
|
+
- **Strategy**: High-level plan to fix the prompt (e.g., "Clarify section X", "Add negative constraint").
|
|
35
36
|
- **Decide**:
|
|
36
37
|
- If **100% pass**: STOP and report success.
|
|
37
38
|
- If **Score decreased**: Revert last change, try different approach.
|
|
38
39
|
- If **No improvement** (2x): STOP and report stagnation.
|
|
39
|
-
- **Log Result**:
|
|
40
|
-
- Append the result of this iteration to the identified optimization log file.
|
|
41
|
-
- **Format**:
|
|
42
|
-
```markdown
|
|
43
|
-
### Iteration [N]
|
|
44
|
-
- **Change**: [Description of edit]
|
|
45
|
-
- **Rationale**: [Root Cause / Why this fix was chosen]
|
|
46
|
-
- **Outcome**: [Success / Failure / Harmful] (Score: X% -> Y%)
|
|
47
|
-
- **Insight**: [Key learning or pattern identified]
|
|
48
|
-
```
|
|
49
40
|
- **Refine (The Curator)**:
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
- **
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
- **Orchestrate Subagent**: Use `runSubagent` to apply the fix.
|
|
42
|
+
- **Task**: Read the relevant prompt file(s), apply the **Strategy** from the Reflector, and generate the log entry.
|
|
43
|
+
- **Output**: The **Log Entry** describing the specific operation performed.
|
|
44
|
+
```markdown
|
|
45
|
+
### Iteration [N]
|
|
46
|
+
- **Operation**: [ADD / UPDATE / DELETE]
|
|
47
|
+
- **Target**: [Section Name]
|
|
48
|
+
- **Change**: [Specific text added/modified]
|
|
49
|
+
- **Trigger**: [Specific failing test case or error pattern]
|
|
50
|
+
- **Rationale**: [From Reflector: Root Cause]
|
|
51
|
+
- **Score**: [From Reflector: Current Pass Rate]
|
|
52
|
+
- **Insight**: [From Reflector: Key Learning]
|
|
53
|
+
```
|
|
54
|
+
- **Strategy**: Treat the prompt as a structured set of rules. Execute atomic operations:
|
|
55
|
+
- **ADD**: Insert a new rule if a constraint was missed.
|
|
56
|
+
- **UPDATE**: Refine an existing rule to be clearer or more general.
|
|
57
|
+
- *Clarify*: Make ambiguous instructions specific.
|
|
58
|
+
- *Generalize*: Refactor specific fixes into high-level principles (First Principles).
|
|
59
|
+
- **DELETE**: Remove obsolete, redundant, or harmful rules.
|
|
60
|
+
- *Prune*: If a general rule covers specific cases, delete the specific ones.
|
|
61
|
+
- **Negative Constraint**: If hallucinating, explicitly state what NOT to do. Prefer generalized prohibitions over specific forbidden tokens where possible.
|
|
56
62
|
- **Safety Check**: Ensure new rules don't contradict existing ones (unless intended).
|
|
57
63
|
- **Constraint**: Avoid rewriting large sections. Make surgical, additive changes to preserve existing behavior.
|
|
58
|
-
|
|
64
|
+
- **Log Result**:
|
|
65
|
+
- Append the **Log Entry** returned by the Curator to the optimization log file.
|
|
59
66
|
|
|
60
67
|
3. **Completion**
|
|
61
68
|
- Report final score.
|
|
@@ -63,7 +70,8 @@ description: Iteratively optimize prompt files against AgentV evaluation dataset
|
|
|
63
70
|
- **Finalize Optimization Log**: Add a summary header to the optimization log file indicating the session completion and final score.
|
|
64
71
|
|
|
65
72
|
## Guidelines
|
|
66
|
-
- **
|
|
73
|
+
- **Generalization First**: Prefer broad, principle-based guidelines over specific examples or "hotfixes". Only use specific rules if generalized instructions fail to achieve the desired score.
|
|
74
|
+
- **Simplicity ("Less is More")**: Avoid overfitting to the test set. If a specific rule doesn't significantly improve the score compared to a general one, choose the general one.
|
|
67
75
|
- **Structure**: Maintain existing Markdown headers/sections.
|
|
68
76
|
- **Progressive Disclosure**: If the prompt grows too large (>200 lines), consider moving specialized logic into a separate file or skill.
|
|
69
77
|
- **Quality Criteria**: Ensure the prompt defines a clear persona, specific task, and measurable success criteria.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentv",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "CLI entry point for AgentV",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"agentv": "./dist/cli.js"
|
|
16
16
|
},
|
|
17
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
18
21
|
"scripts": {
|
|
19
22
|
"dev": "bun --watch src/index.ts",
|
|
20
23
|
"build": "tsup && bun run copy-readme",
|