advisor
Analyze the current project for autoresearch optimization opportunities. Scans the project, identifies candidates matching the keep/revert loop pattern (single mutable artifact, scalar metric, fixed time budget, repeatable execution), and presents ready-to-run suggestions with workflow.yaml snippets. Use when the user asks what they can optimize, what to autoresearch, or how to apply the optimization loop to their project.
What this skill does
# Harness-Optimize Advisor
Analyze a project for autoresearch optimization opportunities and present findings conversationally with concrete, ready-to-use workflow config snippets. Speak to the user — do not return raw JSON.
## Hardware context
```bash
cat "${CLAUDE_PLUGIN_DATA:-${HOME}/.harness}/config.json" 2>/dev/null || echo "NO_CONFIG"
```
If output is `NO_CONFIG`, tell the user to run `/harness:setup` first to register hardware targets, then continue the analysis using `target: local` as a placeholder in any suggested workflow snippets.
## Step 1: Determine the target directory
If `$ARGUMENTS` is provided, treat it as the path to analyze. Otherwise use the current working directory.
```bash
ls -la ${ARGUMENTS:-.}
```
Read key files: `README.md`, `package.json`, `pyproject.toml`, `Cargo.toml`, `Makefile`, main entry points, and any existing benchmark or test scripts. For ML repos specifically, look for `train.py`, `program.md`, `prepare.py`.
## Step 2: Apply the four-condition test
The autoresearch keep/revert loop works when ALL FOUR conditions hold:
| # | Condition | What to look for |
|---|-----------|-----------------|
| 1 | **Single mutable artifact** | One file the agent edits each iteration |
| 2 | **Scalar automated metric** | A number computable without human judgment (lower or higher is better) |
| 3 | **Fixed time-boxed cycle** | Every experiment runs for identical wall-clock time |
| 4 | **Repeatable automated execution** | End-to-end, no human in the loop |
For each candidate you identify, check all four honestly. If the metric requires human judgment or execution isn't fully automated, say so — don't oversell weak fits.
**Strong candidate domains:**
| Domain | Typical artifact | Typical metric | Typical budget |
|--------|-----------------|----------------|----------------|
| ML training | `train.py` | `val_bpb`, `val_loss` | 5 min |
| API latency | route handler | p99 response time (ms) | 2–5 min load test |
| Database queries | query/schema file | execution time (ms) | 1–3 min benchmark |
| Build pipeline | build config | build duration (s) | single build |
| Bundle size | bundler config | output bytes | single build |
| Inference speed | serving/model code | tokens/sec | fixed eval run |
| Prompt quality | prompt template | accuracy on eval set | eval run time |
| ETL pipeline | transform script | wall-clock time | fixed dataset |
**Do not suggest:**
- Subjective quality with no automated metric
- Changes spanning multiple files (violates single-artifact constraint)
- Tasks requiring human judgment to evaluate
## Step 3: Match to hardware
Use the hardware config injected above to recommend the best target for each candidate:
| Scenario | Recommend |
|----------|-----------|
| PyTorch / CUDA workload | `server` or `runpod` |
| Overnight unattended run | `server` or `runpod` — frees the Mac |
| Quick daytime iteration | `local` |
| Apple Silicon / MLX workload | `local` |
| No targets configured | Suggest `/harness:setup` before running |
## Step 4: Present findings
Present **2–3 concrete suggestions** as prose. For each:
1. **Name it** and explain why it fits the pattern
2. **Artifact** — the exact file the agent would edit
3. **Metric** — what to measure and how to extract it from output (show the grep/regex if needed)
4. **Hardware target** — which one and why
5. **Setup needed** — be explicit if a benchmark script must be written first, data must be prepared, etc.
Then show a ready-to-copy workflow.yaml snippet for each:
```yaml
# .harness/workflow.yaml
name: optimize-<what>
phases:
- id: optimize
plugin: harness
type: loop
config:
artifact: "path/to/artifact.py"
metric: "metric_name"
direction: lower # or higher
run_command: "command to run"
time_budget: "5m"
max_experiments: 30
target: local # or server / runpod
# ssh_host: "user@host" # required if target: server
# cwd: "/remote/path" # required if target: server
```
Fill in actual values from your analysis — never leave placeholder text in the snippet.
## Step 5: Offer next steps
After presenting suggestions, close with:
> "Want me to build the full `workflow.yaml` for one of these? If you need a benchmark script written first, I can help with that too. Or run `/harness:setup` to register your hardware targets before we start."
If the project has no strong candidates, say so plainly:
> "I didn't find a strong fit for the autoresearch pattern here. The main blocker is [specific reason]. To make it work, you'd need [what's missing]."
## Constraints
- Prose output only — no raw JSON to the user
- Name actual files and commands found in the project — no generic placeholders
- Maximum 3 suggestions — quality over quantity
- Be honest about weak fits; a missing benchmark script is a real blocker, say so
- If metric extraction requires a custom parser or grep, show it explicitly
Related in Data & Analytics
clawarr-suite
IncludedComprehensive management for self-hosted media stacks (Sonarr, Radarr, Lidarr, Readarr, Prowlarr, Bazarr, Overseerr, Plex, Tautulli, SABnzbd, Recyclarr, Unpackerr, Notifiarr, Maintainerr, Kometa, FlareSolverr). Deep library exploration, analytics, dashboard generation, content management, request handling, subtitle management, indexer control, download monitoring, quality profile sync, library cleanup automation, notification routing, collection/overlay management, and media tracker integration (Trakt, Letterboxd, Simkl).
querying-soql
IncludedSOQL query generation, optimization, and analysis with 100-point scoring. Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance or safety improvements for Salesforce queries. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use handling-sf-data), Apex DML logic (use generating-apex), or report/dashboard queries.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
habit-flow
IncludedAI-powered atomic habit tracker with natural language logging, streak tracking, smart reminders, and coaching. Use for creating habits, logging completions naturally ("I meditated today"), viewing progress, and getting personalized coaching.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
visualizing-data
IncludedBuilds dashboards, reports, and data-driven interfaces requiring charts, graphs, or visual analytics. Provides systematic framework for selecting appropriate visualizations based on data characteristics and analytical purpose. Includes 24+ visualization types organized by purpose (trends, comparisons, distributions, relationships, flows, hierarchies, geospatial), accessibility patterns (WCAG 2.1 AA compliance), colorblind-safe palettes, and performance optimization strategies. Use when creating visualizations, choosing chart types, displaying data graphically, or designing data interfaces.