@openhands/extensions 0.0.1-alpha → 0.2.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/.agents/skills/custom-codereview-guide.md +25 -0
- package/.github/pull_request_template.md +38 -0
- package/.github/release.yml +14 -0
- package/.github/workflows/check-extensions.yml +72 -0
- package/.github/workflows/npm-publish.yml +89 -0
- package/.github/workflows/pr.yml +30 -0
- package/.github/workflows/release.yml +24 -0
- package/.github/workflows/tests.yml +25 -0
- package/.github/workflows/vulnerability-scan.yml +87 -0
- package/.release-please-manifest.json +3 -0
- package/AGENTS.md +132 -0
- package/README.md +10 -0
- package/analysis_results.md +162 -0
- package/marketplaces/large-codebase.json +66 -0
- package/marketplaces/openhands-extensions.json +682 -0
- package/package.json +4 -10
- package/plugins/README.md +30 -0
- package/plugins/city-weather/.plugin/plugin.json +13 -0
- package/plugins/city-weather/README.md +145 -0
- package/plugins/city-weather/commands/now.md +56 -0
- package/plugins/cobol-modernization/.plugin/plugin.json +19 -0
- package/plugins/cobol-modernization/README.md +201 -0
- package/plugins/cobol-modernization/references/troubleshooting.md +18 -0
- package/plugins/cobol-modernization/skills/build-setup/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/build-setup/scripts/install-gnucobol.sh +32 -0
- package/plugins/cobol-modernization/skills/cobol-modernization-overview/SKILL.md +113 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/SKILL.md +62 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/references/cics-transformation-examples.md +45 -0
- package/plugins/cobol-modernization/skills/mainframe-planning/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/to-java-migration/SKILL.md +59 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/cobol-to-java-example.md +58 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/datatype-mappings.md +19 -0
- package/plugins/issue-duplicate-checker/.plugin/plugin.json +13 -0
- package/plugins/issue-duplicate-checker/README.md +51 -0
- package/plugins/issue-duplicate-checker/action.yml +349 -0
- package/plugins/issue-duplicate-checker/scripts/auto_close_duplicate_issues.py +569 -0
- package/plugins/issue-duplicate-checker/scripts/issue_duplicate_check_openhands.py +681 -0
- package/plugins/issue-duplicate-checker/scripts/post_duplicate_notice.js +220 -0
- package/plugins/issue-duplicate-checker/scripts/remove_duplicate_candidate_label.js +27 -0
- package/plugins/magic-test/.plugin/plugin.json +13 -0
- package/plugins/magic-test/skills/magic-word/SKILL.md +33 -0
- package/plugins/migration-scoring/.plugin/plugin.json +19 -0
- package/plugins/migration-scoring/README.md +244 -0
- package/plugins/migration-scoring/skills/migration-mapping/SKILL.md +72 -0
- package/plugins/migration-scoring/skills/migration-report/SKILL.md +118 -0
- package/plugins/migration-scoring/skills/migration-scoring-overview/SKILL.md +126 -0
- package/plugins/migration-scoring/skills/score-quality/SKILL.md +54 -0
- package/plugins/migration-scoring/skills/score-quality/references/scoring-criteria.md +30 -0
- package/plugins/migration-scoring/skills/score-style/SKILL.md +106 -0
- package/plugins/onboarding/.plugin/plugin.json +20 -0
- package/plugins/onboarding/README.md +30 -0
- package/plugins/onboarding/references/criteria.md +144 -0
- package/plugins/onboarding/skills/agent-readiness-report/README.md +23 -0
- package/plugins/onboarding/skills/agent-readiness-report/SKILL.md +122 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_agent_instructions.sh +88 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_build_env.sh +114 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_feedback_loops.sh +133 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_policy.sh +113 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_workflows.sh +127 -0
- package/plugins/onboarding/skills/improve-agent-readiness/README.md +19 -0
- package/plugins/onboarding/skills/improve-agent-readiness/SKILL.md +167 -0
- package/plugins/onboarding/skills/setup-agents-md/README.md +15 -0
- package/plugins/onboarding/skills/setup-agents-md/SKILL.md +150 -0
- package/plugins/onboarding/skills/setup-openhands/README.md +20 -0
- package/plugins/onboarding/skills/setup-openhands/SKILL.md +56 -0
- package/plugins/onboarding/skills/setup-pr-review/README.md +23 -0
- package/plugins/onboarding/skills/setup-pr-review/SKILL.md +72 -0
- package/plugins/openhands/.plugin/plugin.json +13 -0
- package/plugins/openhands/README.md +52 -0
- package/plugins/openhands/SKILL.md +61 -0
- package/plugins/openhands/commands/create.md +55 -0
- package/plugins/openhands/commands/openhands-cloud.md +8 -0
- package/plugins/openhands/scripts/run.sh +69 -0
- package/plugins/pr-review/.plugin/plugin.json +13 -0
- package/plugins/pr-review/README.md +393 -0
- package/plugins/pr-review/action.yml +298 -0
- package/plugins/pr-review/scripts/agent_script.py +1282 -0
- package/plugins/pr-review/scripts/evaluate_review.py +655 -0
- package/plugins/pr-review/scripts/prompt.py +260 -0
- package/plugins/pr-review/workflows/pr-review-by-openhands.yml +51 -0
- package/plugins/pr-review/workflows/pr-review-evaluation.yml +85 -0
- package/plugins/qa-changes/.plugin/plugin.json +11 -0
- package/plugins/qa-changes/README.md +185 -0
- package/plugins/qa-changes/action.yml +181 -0
- package/plugins/qa-changes/scripts/agent_script.py +406 -0
- package/plugins/qa-changes/scripts/evaluate_qa_changes.py +385 -0
- package/plugins/qa-changes/scripts/prompt.py +174 -0
- package/plugins/qa-changes/workflows/qa-changes-by-openhands.yml +50 -0
- package/plugins/qa-changes/workflows/qa-changes-evaluation.yml +85 -0
- package/plugins/release-notes/.plugin/plugin.json +19 -0
- package/plugins/release-notes/README.md +283 -0
- package/plugins/release-notes/SKILL.md +83 -0
- package/plugins/release-notes/action.yml +117 -0
- package/plugins/release-notes/commands/release-notes.md +8 -0
- package/plugins/release-notes/scripts/agent_script.py +292 -0
- package/plugins/release-notes/scripts/generate_release_notes.py +733 -0
- package/plugins/release-notes/scripts/prompt.py +90 -0
- package/plugins/release-notes/scripts/validate_release_notes.py +328 -0
- package/plugins/release-notes/workflows/release-notes.yml +76 -0
- package/plugins/vulnerability-remediation/.plugin/plugin.json +19 -0
- package/plugins/vulnerability-remediation/README.md +217 -0
- package/plugins/vulnerability-remediation/action.yml +187 -0
- package/plugins/vulnerability-remediation/scripts/scan_and_remediate.py +561 -0
- package/plugins/vulnerability-remediation/workflows/vulnerability-scan.yml +87 -0
- package/pyproject.toml +12 -0
- package/release-please-config.json +16 -0
- package/scripts/sync_extensions.py +494 -0
- package/scripts/sync_openhands_sdk_skill.py +264 -0
- package/skills/README.md +159 -0
- package/skills/add-javadoc/.plugin/plugin.json +18 -0
- package/skills/add-javadoc/README.md +40 -0
- package/skills/add-javadoc/SKILL.md +35 -0
- package/skills/add-javadoc/references/example.md +32 -0
- package/skills/add-skill/.plugin/plugin.json +18 -0
- package/skills/add-skill/README.md +67 -0
- package/skills/add-skill/SKILL.md +47 -0
- package/skills/add-skill/scripts/fetch_skill.py +259 -0
- package/skills/agent-creator/.plugin/plugin.json +20 -0
- package/skills/agent-creator/README.md +104 -0
- package/skills/agent-creator/SKILL.md +190 -0
- package/skills/agent-creator/commands/agent-creator.md +8 -0
- package/skills/agent-creator/references/fallback.md +117 -0
- package/skills/agent-memory/.plugin/plugin.json +18 -0
- package/skills/agent-memory/README.md +35 -0
- package/skills/agent-memory/SKILL.md +30 -0
- package/skills/agent-memory/commands/remember.md +8 -0
- package/skills/agent-sdk-builder/.plugin/plugin.json +18 -0
- package/skills/agent-sdk-builder/README.md +40 -0
- package/skills/agent-sdk-builder/SKILL.md +37 -0
- package/skills/agent-sdk-builder/commands/agent-builder.md +8 -0
- package/skills/azure-devops/.plugin/plugin.json +18 -0
- package/skills/azure-devops/README.md +55 -0
- package/skills/azure-devops/SKILL.md +50 -0
- package/skills/bitbucket/.plugin/plugin.json +17 -0
- package/skills/bitbucket/README.md +50 -0
- package/skills/bitbucket/SKILL.md +45 -0
- package/skills/code-review/.plugin/plugin.json +19 -0
- package/skills/code-review/README.md +18 -0
- package/skills/code-review/SKILL.md +208 -0
- package/skills/code-review/commands/codereview-roasted.md +8 -0
- package/skills/code-review/commands/codereview.md +8 -0
- package/skills/code-review/references/risk-evaluation.md +41 -0
- package/skills/code-review/references/supply-chain-security.md +31 -0
- package/skills/code-simplifier/.plugin/plugin.json +21 -0
- package/skills/code-simplifier/README.md +30 -0
- package/skills/code-simplifier/SKILL.md +91 -0
- package/skills/code-simplifier/commands/simplify.md +8 -0
- package/skills/code-simplifier/references/code-quality-review.md +86 -0
- package/skills/code-simplifier/references/code-reuse-review.md +63 -0
- package/skills/code-simplifier/references/efficiency-review.md +81 -0
- package/skills/datadog/.plugin/plugin.json +19 -0
- package/skills/datadog/README.md +100 -0
- package/skills/datadog/SKILL.md +95 -0
- package/skills/deno/.plugin/plugin.json +18 -0
- package/skills/deno/README.md +5 -0
- package/skills/deno/SKILL.md +99 -0
- package/skills/deno/references/README.md +6 -0
- package/skills/discord/.plugin/plugin.json +18 -0
- package/skills/discord/README.md +31 -0
- package/skills/discord/SKILL.md +109 -0
- package/skills/discord/__init__.py +0 -0
- package/skills/discord/references/REFERENCE.md +78 -0
- package/skills/discord/scripts/__init__.py +0 -0
- package/skills/discord/scripts/_http.py +127 -0
- package/skills/discord/scripts/post_webhook.py +106 -0
- package/skills/discord/scripts/send_message.py +102 -0
- package/skills/docker/.plugin/plugin.json +17 -0
- package/skills/docker/README.md +34 -0
- package/skills/docker/SKILL.md +29 -0
- package/skills/evidence-based-citations/.plugin/plugin.json +20 -0
- package/skills/evidence-based-citations/README.md +31 -0
- package/skills/evidence-based-citations/SKILL.md +59 -0
- package/skills/flarglebargle/.plugin/plugin.json +16 -0
- package/skills/flarglebargle/README.md +14 -0
- package/skills/flarglebargle/SKILL.md +9 -0
- package/skills/frontend-design/.plugin/plugin.json +21 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/README.md +42 -0
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/github/.plugin/plugin.json +19 -0
- package/skills/github/README.md +42 -0
- package/skills/github/SKILL.md +106 -0
- package/skills/github-pr-review/.plugin/plugin.json +18 -0
- package/skills/github-pr-review/README.md +145 -0
- package/skills/github-pr-review/SKILL.md +148 -0
- package/skills/github-pr-review/commands/github-pr-review.md +8 -0
- package/skills/github-pr-reviewer/.plugin/plugin.json +20 -0
- package/skills/github-pr-reviewer/README.md +34 -0
- package/skills/github-pr-reviewer/SKILL.md +89 -0
- package/skills/github-pr-reviewer/commands/pr-reviewer:setup.md +8 -0
- package/skills/github-repo-monitor/.plugin/plugin.json +22 -0
- package/skills/github-repo-monitor/README.md +70 -0
- package/skills/github-repo-monitor/SKILL.md +316 -0
- package/skills/github-repo-monitor/commands/github-monitor:poll.md +8 -0
- package/skills/github-repo-monitor/references/github-api.md +241 -0
- package/skills/github-repo-monitor/references/state-schema.md +160 -0
- package/skills/github-repo-monitor/scripts/main.py +915 -0
- package/skills/github-repo-monitor/tests/test_main.py +400 -0
- package/skills/gitlab/.plugin/plugin.json +17 -0
- package/skills/gitlab/README.md +37 -0
- package/skills/gitlab/SKILL.md +32 -0
- package/skills/incident-retrospective/.plugin/plugin.json +21 -0
- package/skills/incident-retrospective/README.md +34 -0
- package/skills/incident-retrospective/SKILL.md +98 -0
- package/skills/incident-retrospective/commands/incident-retro:setup.md +8 -0
- package/skills/iterate/.plugin/plugin.json +13 -0
- package/skills/iterate/README.md +25 -0
- package/skills/iterate/SKILL.md +399 -0
- package/skills/iterate/commands/babysit.md +8 -0
- package/skills/iterate/commands/iterate.md +8 -0
- package/skills/iterate/commands/verify.md +8 -0
- package/skills/iterate/references/heuristics.md +58 -0
- package/skills/iterate/references/verification.md +96 -0
- package/skills/jupyter/.plugin/plugin.json +18 -0
- package/skills/jupyter/README.md +55 -0
- package/skills/jupyter/SKILL.md +50 -0
- package/skills/kubernetes/.plugin/plugin.json +18 -0
- package/skills/kubernetes/README.md +53 -0
- package/skills/kubernetes/SKILL.md +48 -0
- package/skills/learn-from-code-review/.plugin/plugin.json +19 -0
- package/skills/learn-from-code-review/README.md +64 -0
- package/skills/learn-from-code-review/SKILL.md +186 -0
- package/skills/learn-from-code-review/commands/learn-from-reviews.md +8 -0
- package/skills/linear/.plugin/plugin.json +19 -0
- package/skills/linear/README.md +58 -0
- package/skills/linear/SKILL.md +213 -0
- package/skills/linear-triage/.plugin/plugin.json +21 -0
- package/skills/linear-triage/README.md +34 -0
- package/skills/linear-triage/SKILL.md +91 -0
- package/skills/linear-triage/commands/linear-triage:setup.md +8 -0
- package/skills/notion/.plugin/plugin.json +17 -0
- package/skills/notion/README.md +114 -0
- package/skills/notion/SKILL.md +109 -0
- package/skills/npm/.plugin/plugin.json +17 -0
- package/skills/npm/README.md +14 -0
- package/skills/npm/SKILL.md +9 -0
- package/skills/openhands-api/.plugin/plugin.json +22 -0
- package/skills/openhands-api/README.md +48 -0
- package/skills/openhands-api/SKILL.md +399 -0
- package/skills/openhands-api/references/README.md +33 -0
- package/skills/openhands-api/references/TROUBLESHOOTING.md +81 -0
- package/skills/openhands-api/references/example_prompt.md +12 -0
- package/skills/openhands-api/scripts/openhands_api.py +606 -0
- package/skills/openhands-api/scripts/openhands_api.ts +252 -0
- package/skills/openhands-automation/.plugin/plugin.json +19 -0
- package/skills/openhands-automation/README.md +89 -0
- package/skills/openhands-automation/SKILL.md +875 -0
- package/skills/openhands-automation/commands/automation:create.md +8 -0
- package/skills/openhands-automation/references/ab-testing.md +185 -0
- package/skills/openhands-automation/references/custom-automation.md +644 -0
- package/skills/openhands-sdk/.plugin/plugin.json +20 -0
- package/skills/openhands-sdk/README.md +22 -0
- package/skills/openhands-sdk/SKILL.md +229 -0
- package/skills/openhands-sdk/commands/sdk.md +8 -0
- package/skills/pdflatex/.plugin/plugin.json +18 -0
- package/skills/pdflatex/README.md +39 -0
- package/skills/pdflatex/SKILL.md +34 -0
- package/skills/prd/.plugin/plugin.json +19 -0
- package/skills/prd/README.md +28 -0
- package/skills/prd/SKILL.md +237 -0
- package/skills/prd/commands/prd.md +8 -0
- package/skills/qa-changes/README.md +18 -0
- package/skills/qa-changes/SKILL.md +229 -0
- package/skills/qa-changes/commands/qa-changes.md +8 -0
- package/skills/release-notes/README.md +24 -0
- package/skills/release-notes/SKILL.md +19 -0
- package/skills/release-notes/commands/release-notes.md +8 -0
- package/skills/research-brief/.plugin/plugin.json +20 -0
- package/skills/research-brief/README.md +34 -0
- package/skills/research-brief/SKILL.md +99 -0
- package/skills/research-brief/commands/research-brief:setup.md +8 -0
- package/skills/security/.plugin/plugin.json +18 -0
- package/skills/security/README.md +38 -0
- package/skills/security/SKILL.md +33 -0
- package/skills/skill-creator/.plugin/plugin.json +17 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/README.md +182 -0
- package/skills/skill-creator/SKILL.md +545 -0
- package/skills/skill-creator/references/output-patterns.md +82 -0
- package/skills/skill-creator/references/workflows.md +28 -0
- package/skills/skill-creator/scripts/init_skill.py +303 -0
- package/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/skills/slack-channel-monitor/.plugin/plugin.json +21 -0
- package/skills/slack-channel-monitor/README.md +91 -0
- package/skills/slack-channel-monitor/SKILL.md +276 -0
- package/skills/slack-channel-monitor/commands/slack-monitor:poll.md +8 -0
- package/skills/slack-channel-monitor/references/slack-api.md +207 -0
- package/skills/slack-channel-monitor/references/state-schema.md +180 -0
- package/skills/slack-channel-monitor/scripts/main.py +962 -0
- package/skills/slack-standup-digest/.plugin/plugin.json +21 -0
- package/skills/slack-standup-digest/README.md +34 -0
- package/skills/slack-standup-digest/SKILL.md +92 -0
- package/skills/slack-standup-digest/commands/standup-digest:setup.md +8 -0
- package/skills/spark-version-upgrade/.plugin/plugin.json +20 -0
- package/skills/spark-version-upgrade/README.md +54 -0
- package/skills/spark-version-upgrade/SKILL.md +233 -0
- package/skills/ssh/.plugin/plugin.json +18 -0
- package/skills/ssh/README.md +140 -0
- package/skills/ssh/SKILL.md +135 -0
- package/skills/swift-linux/.plugin/plugin.json +17 -0
- package/skills/swift-linux/README.md +86 -0
- package/skills/swift-linux/SKILL.md +81 -0
- package/skills/theme-factory/.plugin/plugin.json +19 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/README.md +58 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/uv/.plugin/plugin.json +18 -0
- package/skills/uv/README.md +5 -0
- package/skills/uv/SKILL.md +95 -0
- package/skills/uv/references/README.md +5 -0
- package/skills/vercel/.plugin/plugin.json +18 -0
- package/skills/vercel/README.md +108 -0
- package/skills/vercel/SKILL.md +103 -0
- package/tests/test_add_skill_installs_to_agents_dir.py +42 -0
- package/tests/test_catalogs.py +109 -0
- package/tests/test_code_review_risk_evaluation.py +94 -0
- package/tests/test_issue_duplicate_checker.py +240 -0
- package/tests/test_openhands_api_python.py +152 -0
- package/tests/test_plugin_manifest.py +83 -0
- package/tests/test_pr_review_diff_payload.py +202 -0
- package/tests/test_pr_review_feedback.py +263 -0
- package/tests/test_pr_review_prompt.py +152 -0
- package/tests/test_pr_review_review_context.py +253 -0
- package/tests/test_qa_changes.py +232 -0
- package/tests/test_qa_changes_evaluation.py +259 -0
- package/tests/test_release_notes_generator.py +990 -0
- package/tests/test_sdk_loading.py +150 -0
- package/tests/test_skill_plugin_loading.py +149 -0
- package/tests/test_skills_have_readme.py +66 -0
- package/tests/test_sync_extensions.py +292 -0
- package/tests/test_workflow_sync.py +46 -0
- package/utils/analysis/README.md +7 -0
- package/utils/analysis/laminar_signals/README.md +211 -0
- package/utils/analysis/laminar_signals/analyze.py +780 -0
- package/utils/analysis/laminar_signals/templates/default.j2 +49 -0
- package/utils/analysis/laminar_signals/templates/pr_review.j2 +61 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Test that workflow files in .github/workflows/ match copies in plugins/*/workflows/."""
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_workflow_files_are_in_sync():
|
|
8
|
+
"""Ensure workflow files in .github/workflows/ are identical to copies in plugin dirs."""
|
|
9
|
+
repo_root = Path(__file__).parent.parent
|
|
10
|
+
workflows_dir = repo_root / ".github" / "workflows"
|
|
11
|
+
|
|
12
|
+
if not workflows_dir.exists():
|
|
13
|
+
return # No workflows directory
|
|
14
|
+
|
|
15
|
+
mismatches = []
|
|
16
|
+
# Check all plugins/*/workflows/ directories
|
|
17
|
+
for copy_path in repo_root.glob("plugins/*/workflows"):
|
|
18
|
+
if not copy_path.is_dir():
|
|
19
|
+
continue
|
|
20
|
+
|
|
21
|
+
for copy_file in copy_path.glob("*.yml"):
|
|
22
|
+
canonical_file = workflows_dir / copy_file.name
|
|
23
|
+
if not canonical_file.exists():
|
|
24
|
+
continue
|
|
25
|
+
|
|
26
|
+
canonical_content = canonical_file.read_text()
|
|
27
|
+
copy_content = copy_file.read_text()
|
|
28
|
+
|
|
29
|
+
if canonical_content != copy_content:
|
|
30
|
+
rel_path = copy_path.relative_to(repo_root)
|
|
31
|
+
mismatches.append(
|
|
32
|
+
f"{rel_path}/{copy_file.name} differs from "
|
|
33
|
+
f".github/workflows/{copy_file.name}"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if mismatches:
|
|
37
|
+
raise AssertionError(
|
|
38
|
+
"Workflow files are out of sync:\n"
|
|
39
|
+
+ "\n".join(f" - {m}" for m in mismatches)
|
|
40
|
+
+ "\n\nRun: cp .github/workflows/<file> <destination> to sync"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
test_workflow_files_are_in_sync()
|
|
46
|
+
print("All workflow files are in sync!")
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Signal Analysis Utilities
|
|
2
|
+
|
|
3
|
+
This directory contains utilities for analyzing signals collected from Laminar to understand AI agent behavior patterns.
|
|
4
|
+
|
|
5
|
+
## Available Utilities
|
|
6
|
+
|
|
7
|
+
- **[laminar_signals/](laminar_signals/)** - Analyze Laminar signal events using LLMs with customizable Jinja2 prompt templates
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Laminar Signal Analysis
|
|
2
|
+
|
|
3
|
+
Analyze Laminar signal events using LLMs to identify issues and areas for improvement. Uses function calling to get structured output with clickable trace URLs.
|
|
4
|
+
|
|
5
|
+
**Primary Focus**: Identifying problems and generating actionable recommendations to improve AI agent behavior.
|
|
6
|
+
|
|
7
|
+
## Directory Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
laminar_signals/
|
|
11
|
+
├── analyze.py # Main analysis script
|
|
12
|
+
├── README.md # This file
|
|
13
|
+
└── templates/
|
|
14
|
+
├── default.j2 # Generic template for any signal type
|
|
15
|
+
└── pr_review.j2 # Specialized template for PR review signals
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
- Python 3.9+
|
|
21
|
+
- `jinja2` package
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install jinja2
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Environment Variables
|
|
28
|
+
|
|
29
|
+
| Variable | Required | Default | Description |
|
|
30
|
+
|----------|----------|---------|-------------|
|
|
31
|
+
| `LMNR_PROJECT_API_KEY` | Yes | - | Laminar project API key |
|
|
32
|
+
| `LMNR_PROJECT_ID` | No | - | Laminar project ID (for generating clickable trace URLs) |
|
|
33
|
+
| `LLM_API_KEY` | Yes | - | API key for the LLM |
|
|
34
|
+
| `LLM_MODEL` | No | `gemini-3-pro-preview` | Model to use |
|
|
35
|
+
| `LLM_BASE_URL` | No | `https://llm-proxy.app.all-hands.dev` | Base URL for LLM API |
|
|
36
|
+
|
|
37
|
+
**Note:** To enable clickable trace URLs in the output, set `LMNR_PROJECT_ID` to your Laminar project ID.
|
|
38
|
+
You can find this in your Laminar dashboard URL: `https://laminar.sh/project/{PROJECT_ID}/...`
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# List available signals
|
|
44
|
+
python analyze.py --list-signals
|
|
45
|
+
|
|
46
|
+
# Analyze PR review signals (outputs markdown by default)
|
|
47
|
+
python analyze.py --signal "pr review suggestion and analysis"
|
|
48
|
+
|
|
49
|
+
# Analyze with skill context for grounded recommendations
|
|
50
|
+
python analyze.py --signal "pr review suggestion and analysis" \
|
|
51
|
+
--skill-dir ../../../plugins/pr-review
|
|
52
|
+
|
|
53
|
+
# Output as JSON (structured data with trace URLs)
|
|
54
|
+
python analyze.py --signal "pr review suggestion and analysis" --format json
|
|
55
|
+
|
|
56
|
+
# Analyze with custom prompt template
|
|
57
|
+
python analyze.py --signal "my-signal" --prompt-file my_prompt.j2
|
|
58
|
+
|
|
59
|
+
# Analyze last 30 days and save to file
|
|
60
|
+
python analyze.py --signal "my-signal" --days 30 --output results.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## How It Works
|
|
64
|
+
|
|
65
|
+
1. **Fetches Signals**: Queries the Laminar SQL API to retrieve signal events with trace IDs.
|
|
66
|
+
|
|
67
|
+
2. **Generates Prompt**: Uses a Jinja2 template focused on identifying issues and improvements.
|
|
68
|
+
|
|
69
|
+
3. **Loads Skill Context** (optional): If `--skill-dir` is provided, loads the skill/plugin content so recommendations can reference specific prompt verbiage.
|
|
70
|
+
|
|
71
|
+
4. **LLM Analysis**: Uses **function calling** to get structured output with:
|
|
72
|
+
- `issues`: Problems and failures with severity, frequency, and clickable trace URLs
|
|
73
|
+
- `recommendations`: Specific fixes with priority levels (grounded in skill content when provided)
|
|
74
|
+
- `metrics`: Quantitative statistics (issue rate, etc.)
|
|
75
|
+
- `strengths`: Brief note on what's working (secondary focus)
|
|
76
|
+
|
|
77
|
+
5. **Output**: Markdown report (default) or JSON for programmatic use.
|
|
78
|
+
|
|
79
|
+
## Grounding Recommendations in Skills
|
|
80
|
+
|
|
81
|
+
Use `--skill-dir` to provide the current skill/plugin configuration. This allows the LLM to:
|
|
82
|
+
- Reference specific sections of the prompt that need changes
|
|
83
|
+
- Suggest exact wording modifications
|
|
84
|
+
- Ground recommendations in the actual instructions the agent follows
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Use a skill directory
|
|
88
|
+
python analyze.py --signal "..." --skill-dir path/to/skills/code-review
|
|
89
|
+
|
|
90
|
+
# Use a plugin directory (loads nested skills and prompt.py)
|
|
91
|
+
python analyze.py --signal "..." --skill-dir path/to/plugins/pr-review
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The script automatically loads:
|
|
95
|
+
- `SKILL.md` from the directory
|
|
96
|
+
- `scripts/prompt.py` if present (for plugins)
|
|
97
|
+
- Any nested skills in `skills/` subdirectory
|
|
98
|
+
|
|
99
|
+
## Output Structure
|
|
100
|
+
|
|
101
|
+
### Issues (Primary Focus)
|
|
102
|
+
|
|
103
|
+
Each issue includes:
|
|
104
|
+
- **Title**: Short description
|
|
105
|
+
- **Description**: Detailed explanation of the problem
|
|
106
|
+
- **Severity**: critical / high / medium / low
|
|
107
|
+
- **Frequency**: How often this occurs
|
|
108
|
+
- **Trace URLs**: Clickable links to example traces in Laminar
|
|
109
|
+
|
|
110
|
+
### Recommendations
|
|
111
|
+
|
|
112
|
+
Each recommendation includes:
|
|
113
|
+
- **Title**: Short description
|
|
114
|
+
- **Description**: How to implement the fix
|
|
115
|
+
- **Addresses**: Which issues this fixes
|
|
116
|
+
- **Priority**: high / medium / low
|
|
117
|
+
|
|
118
|
+
### Example JSON Output
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"issues": [
|
|
123
|
+
{
|
|
124
|
+
"title": "Premature Approval of Functional Defects",
|
|
125
|
+
"description": "The AI approves code with known issues...",
|
|
126
|
+
"severity": "critical",
|
|
127
|
+
"frequency": "10-15% of traces",
|
|
128
|
+
"trace_urls": [
|
|
129
|
+
"https://www.lmnr.ai/traces/a0dbd0c7-116d-776b-9c4b-c7f5f4d0a97e",
|
|
130
|
+
"https://www.lmnr.ai/traces/5de277ff-38f2-e173-4b03-c7332301ea58"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"recommendations": [
|
|
135
|
+
{
|
|
136
|
+
"title": "Enforce Logic Verification Over Style",
|
|
137
|
+
"description": "Modify the prompt to separate style from logic analysis...",
|
|
138
|
+
"addresses": ["Premature Approval of Functional Defects"],
|
|
139
|
+
"priority": "high"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"metrics": {
|
|
143
|
+
"total_signals": 50,
|
|
144
|
+
"issue_rate": "30%",
|
|
145
|
+
"key_statistics": [...]
|
|
146
|
+
},
|
|
147
|
+
"strengths": [
|
|
148
|
+
{"title": "Security Analysis", "description": "..."}
|
|
149
|
+
],
|
|
150
|
+
"summary": "Executive summary of critical improvements needed..."
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Example Markdown Output
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
# Agent Improvement Report
|
|
158
|
+
|
|
159
|
+
**Signal:** `pr review suggestion and analysis`
|
|
160
|
+
|
|
161
|
+
## Executive Summary
|
|
162
|
+
|
|
163
|
+
The AI agent demonstrates strong security awareness but suffers from...
|
|
164
|
+
|
|
165
|
+
## Issues Requiring Attention
|
|
166
|
+
|
|
167
|
+
### 1. [CRITICAL] Premature Approval of Functional Defects
|
|
168
|
+
|
|
169
|
+
The AI approves code with known issues...
|
|
170
|
+
|
|
171
|
+
**Frequency:** 10-15% of traces
|
|
172
|
+
|
|
173
|
+
**Example traces:**
|
|
174
|
+
- https://www.lmnr.ai/traces/a0dbd0c7-116d-776b-9c4b-c7f5f4d0a97e
|
|
175
|
+
- https://www.lmnr.ai/traces/5de277ff-38f2-e173-4b03-c7332301ea58
|
|
176
|
+
|
|
177
|
+
## Recommended Fixes
|
|
178
|
+
|
|
179
|
+
### 1. [HIGH PRIORITY] Enforce Logic Verification Over Style
|
|
180
|
+
|
|
181
|
+
Modify the prompt to separate style from logic analysis...
|
|
182
|
+
|
|
183
|
+
*Fixes: Premature Approval of Functional Defects*
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Custom Prompt Templates
|
|
187
|
+
|
|
188
|
+
Create a Jinja2 template (`.j2`) with access to:
|
|
189
|
+
|
|
190
|
+
| Variable | Type | Description |
|
|
191
|
+
|----------|------|-------------|
|
|
192
|
+
| `signals` | `list[dict]` | List of parsed signal objects |
|
|
193
|
+
| `num_signals` | `int` | Number of signals |
|
|
194
|
+
| `signal_name` | `str` | Name of the signal |
|
|
195
|
+
|
|
196
|
+
Each signal object contains:
|
|
197
|
+
- `trace_url`: Full URL to view the trace in Laminar
|
|
198
|
+
- `trace_id`: Trace UUID
|
|
199
|
+
- `timestamp`: When the signal was created
|
|
200
|
+
- `payload`: Parsed payload as dict
|
|
201
|
+
- `payload_json`: Formatted JSON string
|
|
202
|
+
- All payload fields flattened to top level
|
|
203
|
+
|
|
204
|
+
## Laminar SQL API Reference
|
|
205
|
+
|
|
206
|
+
The script uses Laminar's SQL API at `/v1/sql/query`. Key tables:
|
|
207
|
+
|
|
208
|
+
- `signal_events`: Signal events with trace_id and payload
|
|
209
|
+
- `traces`: Trace-level aggregates
|
|
210
|
+
|
|
211
|
+
See [Laminar SQL Editor documentation](https://docs.laminar.sh/platform/sql-editor) for details.
|