@bohuyeshan/openagent-labforge-core 3.11.2 → 3.11.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/README.ja.md +34 -27
- package/README.ko.md +34 -27
- package/README.md +244 -187
- package/README.ru.md +28 -21
- package/README.zh-cn.md +244 -187
- package/bin/platform.test.ts +21 -20
- package/dist/agents/atlas/default.d.ts +1 -1
- package/dist/agents/atlas/gemini.d.ts +1 -1
- package/dist/agents/atlas/gpt.d.ts +1 -1
- package/dist/agents/bio-methodologist.d.ts +1 -1
- package/dist/agents/bio-pipeline-operator.d.ts +1 -1
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -0
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/metis.d.ts +1 -1
- package/dist/agents/prometheus/gemini.d.ts +1 -1
- package/dist/agents/prometheus/gpt.d.ts +1 -1
- package/dist/agents/prometheus/interview-mode.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/cli/config-manager/bun-install.d.ts +6 -1
- package/dist/cli/config-manager/plugin-name-with-version.d.ts +1 -1
- package/dist/cli/doctor/constants.d.ts +1 -1
- package/dist/cli/index.js +763 -467
- package/dist/cli/install-validators.d.ts +1 -0
- package/dist/cli/model-fallback-types.d.ts +1 -0
- package/dist/cli/openai-only-model-catalog.d.ts +3 -0
- package/dist/cli/run/index.d.ts +1 -0
- package/dist/cli/run/model-resolver.d.ts +4 -0
- package/dist/cli/run/types.d.ts +1 -0
- package/dist/cli/types.d.ts +3 -0
- package/dist/config/schema/agent-names.d.ts +3 -1
- package/dist/config/schema/background-task.d.ts +2 -0
- package/dist/config/schema/git-env-prefix.d.ts +5 -0
- package/dist/config/schema/git-master.d.ts +1 -0
- package/dist/config/schema/hooks.d.ts +2 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +54 -1
- package/dist/config/schema.d.ts +1 -0
- package/dist/create-hooks.d.ts +13 -0
- package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +16 -1
- package/dist/features/background-agent/constants.d.ts +1 -1
- package/dist/features/background-agent/manager.d.ts +20 -4
- package/dist/features/background-agent/process-cleanup.d.ts +1 -1
- package/dist/features/background-agent/remove-task-toast-tracking.d.ts +1 -0
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +23 -0
- package/dist/features/background-agent/task-history.d.ts +1 -0
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +4 -0
- package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +4 -0
- package/dist/features/claude-code-agent-loader/loader.d.ts +3 -3
- package/dist/features/claude-code-agent-loader/types.d.ts +8 -1
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +2 -2
- package/dist/features/claude-code-plugin-loader/loader.d.ts +2 -2
- package/dist/features/claude-code-plugin-loader/types.d.ts +1 -1
- package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -1
- package/dist/features/skill-mcp-manager/types.d.ts +4 -0
- package/dist/features/tmux-subagent/index.d.ts +1 -0
- package/dist/features/tmux-subagent/manager.d.ts +5 -0
- package/dist/features/tmux-subagent/pane-state-parser.d.ts +8 -0
- package/dist/features/tmux-subagent/tracked-session-state.d.ts +8 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/atlas/boulder-session-lineage.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-approval-gate.d.ts +4 -0
- package/dist/hooks/atlas/idle-event.d.ts +8 -0
- package/dist/hooks/atlas/resolve-active-boulder-session.d.ts +11 -0
- package/dist/hooks/atlas/tool-execute-after.d.ts +2 -0
- package/dist/hooks/atlas/types.d.ts +2 -0
- package/dist/hooks/atlas/verification-reminders.d.ts +4 -0
- package/dist/hooks/auto-slash-command/hook.d.ts +7 -0
- package/dist/hooks/auto-slash-command/processed-command-store.d.ts +7 -0
- package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +7 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +3 -1
- package/dist/hooks/auto-update-checker/constants.d.ts +2 -2
- package/dist/hooks/comment-checker/downloader.d.ts +1 -1
- package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +1 -0
- package/dist/hooks/compaction-context-injector/constants.d.ts +5 -0
- package/dist/hooks/compaction-context-injector/hook.d.ts +5 -1
- package/dist/hooks/compaction-context-injector/recovery-prompt-config.d.ts +6 -0
- package/dist/hooks/compaction-context-injector/recovery.d.ts +6 -0
- package/dist/hooks/compaction-context-injector/session-id.d.ts +2 -0
- package/dist/hooks/compaction-context-injector/session-prompt-config-resolver.d.ts +16 -0
- package/dist/hooks/compaction-context-injector/tail-monitor.d.ts +13 -0
- package/dist/hooks/compaction-context-injector/types.d.ts +43 -0
- package/dist/hooks/compaction-context-injector/validated-model.d.ts +13 -0
- package/dist/hooks/context-window-monitor.d.ts +2 -5
- package/dist/hooks/delegate-task-english-directive/hook.d.ts +14 -0
- package/dist/hooks/delegate-task-english-directive/index.d.ts +1 -0
- package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +23 -0
- package/dist/hooks/gpt-permission-continuation/constants.d.ts +4 -0
- package/dist/hooks/gpt-permission-continuation/detector.d.ts +1 -0
- package/dist/hooks/gpt-permission-continuation/handler.d.ts +12 -0
- package/dist/hooks/gpt-permission-continuation/index.d.ts +13 -0
- package/dist/hooks/gpt-permission-continuation/session-state.d.ts +15 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/keyword-detector/hook.d.ts +1 -0
- package/dist/hooks/preemptive-compaction.d.ts +2 -5
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +16 -0
- package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +10 -0
- package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +11 -0
- package/dist/hooks/runtime-fallback/hook.d.ts +2 -3
- package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +4 -0
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +1 -2
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +7 -0
- package/dist/hooks/runtime-fallback/session-messages.d.ts +9 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +3 -0
- package/dist/hooks/runtime-fallback/types.d.ts +57 -3
- package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +3 -0
- package/dist/hooks/session-notification-content.d.ts +30 -0
- package/dist/hooks/session-notification-scheduler.d.ts +5 -3
- package/dist/hooks/session-notification.d.ts +2 -0
- package/dist/hooks/start-work/index.d.ts +1 -1
- package/dist/hooks/start-work/worktree-detector.d.ts +7 -0
- package/dist/hooks/todo-continuation-enforcer/constants.d.ts +6 -2
- package/dist/hooks/todo-continuation-enforcer/handler.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +10 -1
- package/dist/hooks/todo-continuation-enforcer/stagnation-detection.d.ts +6 -0
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +5 -0
- package/dist/hooks/tool-output-truncator.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10638 -7240
- package/dist/openagent-labforge.schema.json +70 -4
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
- package/dist/plugin/normalize-tool-arg-schemas.d.ts +2 -0
- package/dist/plugin/ultrawork-model-override.d.ts +1 -15
- package/dist/plugin/ultrawork-variant-availability.d.ts +6 -0
- package/dist/plugin-dispose.d.ts +10 -0
- package/dist/plugin-handlers/agent-override-protection.d.ts +3 -0
- package/dist/plugin-state.d.ts +5 -0
- package/dist/shared/compaction-agent-config-checkpoint.d.ts +11 -0
- package/dist/shared/context-limit-resolver.d.ts +5 -0
- package/dist/shared/data-path.d.ts +2 -2
- package/dist/shared/dynamic-truncator.d.ts +4 -7
- package/dist/shared/external-plugin-detector.d.ts +1 -1
- package/dist/shared/fallback-chain-from-models.d.ts +3 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/model-error-classifier.d.ts +2 -1
- package/dist/shared/opencode-command-dirs.d.ts +3 -0
- package/dist/shared/plugin-identity.d.ts +7 -0
- package/dist/shared/question-denied-session-permission.d.ts +6 -0
- package/dist/shared/retry-status-utils.d.ts +2 -0
- package/dist/shared/session-model-state.d.ts +4 -0
- package/dist/shared/system-directive.d.ts +6 -5
- package/dist/shared/vision-capable-models-cache.d.ts +4 -0
- package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
- package/dist/tools/call-omo-agent/constants.d.ts +1 -1
- package/dist/tools/call-omo-agent/sync-executor.d.ts +11 -3
- package/dist/tools/call-omo-agent/tools.d.ts +2 -1
- package/dist/tools/delegate-task/cancel-unstable-agent-task.d.ts +2 -0
- package/dist/tools/delegate-task/model-selection.d.ts +1 -0
- package/dist/tools/delegate-task/model-string-parser.d.ts +1 -3
- package/dist/tools/look-at/multimodal-fallback-chain.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +1 -0
- package/dist/tools/lsp/directory-diagnostics.d.ts +1 -0
- package/dist/tools/lsp/lsp-client-transport.d.ts +4 -2
- package/dist/tools/lsp/lsp-client-wrapper.d.ts +2 -1
- package/dist/tools/lsp/server-path-bases.d.ts +1 -0
- package/generated/skills-bundles/catalog.json +282 -39
- package/generated/skills-bundles/full/INDEX.md +38 -10
- package/generated/skills-bundles/full/skills/data-analysis/experiment-monitoring/auto-claude__monitor-experiment/SKILL.md +63 -0
- package/generated/skills-bundles/full/skills/data-analysis/experiment-ops/auto-claude__run-experiment/SKILL.md +112 -0
- package/generated/skills-bundles/full/skills/data-analysis/optimization/auto-claude__dse-loop/SKILL.md +279 -0
- package/generated/skills-bundles/full/skills/data-analysis/statistics/auto-claude__analyze-results/SKILL.md +47 -0
- package/generated/skills-bundles/full/skills/data-analysis/visualization/auto-claude__paper-figure/SKILL.md +281 -0
- package/generated/skills-bundles/full/skills/productivity/communication/auto-claude__feishu-notify/SKILL.md +154 -0
- package/generated/skills-bundles/full/skills/productivity/visual-design/auto-claude__pixel-art/SKILL.md +138 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-compile/SKILL.md +252 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-plan/SKILL.md +254 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/SKILL.md +310 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/iclr2026.tex +84 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/icml2025.tex +87 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/math_commands.tex +48 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/neurips2025.tex +80 -0
- package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-writing/SKILL.md +255 -0
- package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__arxiv/SKILL.md +133 -0
- package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__novelty-check/SKILL.md +87 -0
- package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__research-lit/SKILL.md +194 -0
- package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-creator/SKILL.md +228 -0
- package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-discovery/SKILL.md +186 -0
- package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-discovery-robot/SKILL.md +351 -0
- package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__research-pipeline/SKILL.md +174 -0
- package/generated/skills-bundles/full/skills/research/theory-writing/auto-claude__proof-writer/SKILL.md +224 -0
- package/generated/skills-bundles/paper/INDEX.md +40 -0
- package/generated/skills-bundles/paper/skills/data-analysis/experiment-monitoring/auto-claude__monitor-experiment/SKILL.md +63 -0
- package/generated/skills-bundles/paper/skills/data-analysis/experiment-ops/auto-claude__run-experiment/SKILL.md +112 -0
- package/generated/skills-bundles/paper/skills/data-analysis/optimization/auto-claude__dse-loop/SKILL.md +279 -0
- package/generated/skills-bundles/paper/skills/data-analysis/statistics/auto-claude__analyze-results/SKILL.md +47 -0
- package/generated/skills-bundles/paper/skills/data-analysis/visualization/auto-claude__paper-figure/SKILL.md +281 -0
- package/generated/skills-bundles/paper/skills/productivity/communication/auto-claude__feishu-notify/SKILL.md +154 -0
- package/generated/skills-bundles/paper/skills/productivity/visual-design/auto-claude__pixel-art/SKILL.md +138 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-compile/SKILL.md +252 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-plan/SKILL.md +254 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/SKILL.md +310 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/iclr2026.tex +84 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/icml2025.tex +87 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/math_commands.tex +48 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/neurips2025.tex +80 -0
- package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-writing/SKILL.md +255 -0
- package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__arxiv/SKILL.md +133 -0
- package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__novelty-check/SKILL.md +87 -0
- package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__research-lit/SKILL.md +194 -0
- package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-creator/SKILL.md +228 -0
- package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-discovery/SKILL.md +186 -0
- package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-discovery-robot/SKILL.md +351 -0
- package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__research-pipeline/SKILL.md +174 -0
- package/generated/skills-bundles/paper/skills/research/theory-writing/auto-claude__proof-writer/SKILL.md +224 -0
- package/package.json +21 -21
- package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/LICENSE.txt +0 -21
- package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/SKILL.md +0 -615
- package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/_meta.json +0 -11
- package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/scripts/virtualbox-utils.ts +0 -586
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/.clawhubsafe +0 -0
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/LICENSE +0 -21
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/README.md +0 -127
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/SECURITY.md +0 -68
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/SKILL.md +0 -141
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/_meta.json +0 -11
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/scripts/speak.sh +0 -52
- package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/scripts/transcribe.sh +0 -50
- package/generated/skills-bundles/full/skills/research/media-search/skills-main__youtube-search/LICENSE.txt +0 -21
- package/generated/skills-bundles/full/skills/research/media-search/skills-main__youtube-search/SKILL.md +0 -416
- package/generated/skills-bundles/full/skills/research/media-search/skills-main__youtube-search/_meta.json +0 -11
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "auto-claude/dse-loop"
|
|
3
|
+
description: "Autonomous design space exploration loop for computer architecture and EDA. Runs a program, analyzes results, tunes parameters, and iterates until objective is met or timeout. Use when user says \"DSE\", \"design space exploration\", \"sweep parameters\", \"optimize\", \"find best config\", or wants iterative parameter tuning."
|
|
4
|
+
argument-hint: ["task-description — include program","parameters","objective","and timeout"]
|
|
5
|
+
allowed-tools: "Bash(*), Read, Grep, Glob, Write, Edit, Agent"
|
|
6
|
+
metadata:
|
|
7
|
+
category: "data-analysis/optimization"
|
|
8
|
+
---
|
|
9
|
+
# DSE Loop: Autonomous Design Space Exploration
|
|
10
|
+
|
|
11
|
+
Autonomously explore a design space: run → analyze → pick next parameters → repeat, until the objective is met or timeout is reached. Designed for computer architecture and EDA problems.
|
|
12
|
+
|
|
13
|
+
## Context: $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Safety Rules — READ FIRST
|
|
16
|
+
|
|
17
|
+
**NEVER do any of the following:**
|
|
18
|
+
- `sudo` anything
|
|
19
|
+
- `rm -rf`, `rm -r`, or any recursive deletion
|
|
20
|
+
- `rm` any file you did not create in this session
|
|
21
|
+
- Overwrite existing source files without reading them first
|
|
22
|
+
- `git push`, `git reset --hard`, or any destructive git operation
|
|
23
|
+
- Kill processes you did not start
|
|
24
|
+
|
|
25
|
+
**If a step requires any of the above, STOP and report to the user.**
|
|
26
|
+
|
|
27
|
+
## Constants (override via $ARGUMENTS)
|
|
28
|
+
|
|
29
|
+
| Constant | Default | Description |
|
|
30
|
+
|----------|---------|-------------|
|
|
31
|
+
| `TIMEOUT` | 2h | Total wall-clock budget. Stop exploring after this. |
|
|
32
|
+
| `MAX_ITERATIONS` | 50 | Hard cap on number of design points evaluated. |
|
|
33
|
+
| `PATIENCE` | 10 | Stop early if no improvement for this many consecutive iterations. |
|
|
34
|
+
| `OBJECTIVE` | minimize | `minimize` or `maximize` the target metric. |
|
|
35
|
+
|
|
36
|
+
Override inline: `/dse-loop "task desc — timeout: 4h, max_iterations: 100, patience: 15"`
|
|
37
|
+
|
|
38
|
+
## Typical Use Cases
|
|
39
|
+
|
|
40
|
+
| Problem | Program | Parameters | Objective |
|
|
41
|
+
|---------|---------|-----------|-----------|
|
|
42
|
+
| Microarch DSE | gem5 simulation | cache size, assoc, pipeline width, ROB size, branch predictor | maximize IPC or minimize area×delay |
|
|
43
|
+
| Synthesis tuning | yosys/DC script | optimization passes, target freq, effort level | minimize area at timing closure |
|
|
44
|
+
| RTL parameterization | verilator sim | data width, FIFO depth, pipeline stages, buffer sizes | meet throughput target at min area |
|
|
45
|
+
| Compiler flags | gcc/llvm build + benchmark | -O levels, unroll factor, vectorization, scheduling | minimize runtime or code size |
|
|
46
|
+
| Placement/routing | openroad/innovus | utilization, aspect ratio, layer config | minimize wirelength / timing |
|
|
47
|
+
| Formal verification | abc/sby | bound depth, engine, timeout per property | maximize coverage in time budget |
|
|
48
|
+
| Memory subsystem | cacti / ramulator | bank count, row buffer policy, scheduling | optimize bandwidth/energy |
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
### Phase 0: Parse Task & Setup
|
|
53
|
+
|
|
54
|
+
1. **Parse $ARGUMENTS** to extract:
|
|
55
|
+
- **Program**: what to run (command, script, or Makefile target)
|
|
56
|
+
- **Parameter space**: which knobs to tune and their ranges/options (may be incomplete — see step 2)
|
|
57
|
+
- **Objective metric**: what to optimize (and how to extract it from output)
|
|
58
|
+
- **Constraints**: hard limits that must not be violated (e.g., timing must close)
|
|
59
|
+
- **Timeout**: wall-clock budget
|
|
60
|
+
- **Success criteria**: when is the result "good enough" to stop early?
|
|
61
|
+
|
|
62
|
+
2. **Infer missing parameter ranges** — If the user provides parameter names but NOT ranges/options, you MUST infer them before exploring:
|
|
63
|
+
|
|
64
|
+
a. **Read the source code** — search for the parameter names in the codebase:
|
|
65
|
+
- Look for argparse/click definitions, config files, Makefile variables, module parameters, `#define`, `parameter` (SystemVerilog), `localparam`, etc.
|
|
66
|
+
- Extract defaults, types, and any comments hinting at valid values
|
|
67
|
+
|
|
68
|
+
b. **Apply domain knowledge** to set reasonable ranges:
|
|
69
|
+
| Parameter type | Inference strategy |
|
|
70
|
+
|---------------|-------------------|
|
|
71
|
+
| Cache/memory sizes | Powers of 2, typically 1KB–16MB |
|
|
72
|
+
| Associativity | Powers of 2: 1, 2, 4, 8, 16 |
|
|
73
|
+
| Pipeline width / issue width | Small integers: 1, 2, 4, 8 |
|
|
74
|
+
| Buffer/queue/FIFO depth | Powers of 2: 4, 8, 16, 32, 64 |
|
|
75
|
+
| Clock period / frequency | Based on technology node; try ±50% from default |
|
|
76
|
+
| Bound depth (BMC/formal) | Geometric: 5, 10, 20, 50, 100 |
|
|
77
|
+
| Timeout values | Geometric: 10s, 30s, 60s, 120s, 300s |
|
|
78
|
+
| Boolean/enum flags | Enumerate all options found in source |
|
|
79
|
+
| Continuous (learning rate, threshold) | Log-scale sweep: 5 points spanning 2 orders of magnitude around default |
|
|
80
|
+
| Integer counts (threads, cores) | Linear: from 1 to hardware max |
|
|
81
|
+
|
|
82
|
+
c. **Start conservative** — begin with 3-5 values per parameter. Expand range later if the best result is at a boundary.
|
|
83
|
+
|
|
84
|
+
d. **Log inferred ranges** — write the inferred parameter space to `dse_results/inferred_params.md` so the user can review:
|
|
85
|
+
```markdown
|
|
86
|
+
# Inferred Parameter Space
|
|
87
|
+
|
|
88
|
+
| Parameter | Source | Default | Inferred Range | Reasoning |
|
|
89
|
+
|-----------|--------|---------|---------------|-----------|
|
|
90
|
+
| CACHE_SIZE | config.py:42 | 32768 | [8192, 16384, 32768, 65536, 131072] | powers of 2, ±2x from default |
|
|
91
|
+
| ASSOC | config.py:43 | 4 | [1, 2, 4, 8] | standard associativities |
|
|
92
|
+
| BMC_DEPTH | run_bmc.py:15 | 10 | [5, 10, 20, 50] | geometric, common BMC depths |
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
e. **Boundary expansion** — during the search, if the best result is at the min or max of a range, automatically extend that range by one step in that direction (but log the extension).
|
|
96
|
+
|
|
97
|
+
3. **Read the project** to understand:
|
|
98
|
+
- How to run the program
|
|
99
|
+
- Where results are produced (stdout, log files, reports)
|
|
100
|
+
- How to parse the objective metric from output
|
|
101
|
+
- Current/baseline configuration (if any)
|
|
102
|
+
|
|
103
|
+
4. **Create working directory**: `dse_results/` in project root
|
|
104
|
+
- `dse_results/dse_log.csv` — one row per design point
|
|
105
|
+
- `dse_results/DSE_REPORT.md` — final report
|
|
106
|
+
- `dse_results/DSE_STATE.json` — state for recovery
|
|
107
|
+
- `dse_results/inferred_params.md` — inferred parameter space (if ranges were not provided)
|
|
108
|
+
- `dse_results/configs/` — config files for each run
|
|
109
|
+
- `dse_results/outputs/` — raw output for each run
|
|
110
|
+
|
|
111
|
+
5. **Write a parameter extraction script** (`dse_results/parse_result.py` or similar) that takes a run's output and returns the objective metric as a number. Test it on a baseline run first.
|
|
112
|
+
|
|
113
|
+
6. **Run baseline** (iteration 0): run the program with default/current parameters. Record the baseline metric. This is the point to beat.
|
|
114
|
+
|
|
115
|
+
### Phase 1: Initial Exploration
|
|
116
|
+
|
|
117
|
+
**Goal**: Quickly survey the space to understand which parameters matter most.
|
|
118
|
+
|
|
119
|
+
**Strategy**: Latin Hypercube Sampling or structured sweep of key parameters.
|
|
120
|
+
|
|
121
|
+
1. Pick 5-10 diverse design points that span the parameter ranges
|
|
122
|
+
2. Run them (in parallel if independent, via background processes or sequential)
|
|
123
|
+
3. Record all results in `dse_log.csv`:
|
|
124
|
+
```
|
|
125
|
+
iteration,param1,param2,...,metric,constraint_met,timestamp,notes
|
|
126
|
+
0,default,default,...,baseline_val,yes,2026-03-13T10:00:00,baseline
|
|
127
|
+
1,val1a,val2a,...,result1,yes,2026-03-13T10:05:00,initial sweep
|
|
128
|
+
...
|
|
129
|
+
```
|
|
130
|
+
4. Analyze: which parameters have the most impact on the objective?
|
|
131
|
+
5. Narrow the search to the most sensitive parameters
|
|
132
|
+
|
|
133
|
+
### Phase 2: Directed Search
|
|
134
|
+
|
|
135
|
+
**Goal**: Converge toward the optimum by making informed choices.
|
|
136
|
+
|
|
137
|
+
**Strategy**: Adaptive — pick the approach that fits the problem:
|
|
138
|
+
|
|
139
|
+
- **Few parameters (≤3)**: Fine-grained grid search around the best region from Phase 1
|
|
140
|
+
- **Many parameters (>3)**: Coordinate descent — optimize one parameter at a time, holding others at current best
|
|
141
|
+
- **Binary/categorical params**: Enumerate promising combinations
|
|
142
|
+
- **Continuous params**: Binary search or golden section between best neighbors
|
|
143
|
+
- **Multi-objective**: Track Pareto frontier, explore along the front
|
|
144
|
+
|
|
145
|
+
For each iteration:
|
|
146
|
+
|
|
147
|
+
1. **Select next design point** based on results so far:
|
|
148
|
+
- Look at the trend: which direction improves the metric?
|
|
149
|
+
- Avoid re-running configurations already evaluated
|
|
150
|
+
- Balance exploration (untested regions) vs exploitation (near current best)
|
|
151
|
+
|
|
152
|
+
2. **Modify parameters**: edit config file, command-line args, or source constants
|
|
153
|
+
|
|
154
|
+
3. **Run the program**: execute and capture output
|
|
155
|
+
|
|
156
|
+
4. **Parse results**: extract the objective metric and check constraints
|
|
157
|
+
|
|
158
|
+
5. **Log to `dse_log.csv`**: append the new row
|
|
159
|
+
|
|
160
|
+
6. **Check stopping conditions**:
|
|
161
|
+
- Timeout reached? → stop
|
|
162
|
+
- Max iterations reached? → stop
|
|
163
|
+
- Patience exhausted (no improvement in N iterations)? → stop
|
|
164
|
+
- Success criteria met (metric is "good enough")? → stop
|
|
165
|
+
- Constraint violation pattern detected? → adjust search bounds
|
|
166
|
+
|
|
167
|
+
7. **Update `DSE_STATE.json`**:
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"iteration": 15,
|
|
171
|
+
"status": "in_progress",
|
|
172
|
+
"best_metric": 1.23,
|
|
173
|
+
"best_params": {"cache_size": 32768, "assoc": 4, "pipeline_width": 2},
|
|
174
|
+
"total_iterations": 15,
|
|
175
|
+
"start_time": "2026-03-13T10:00:00",
|
|
176
|
+
"timeout": "2h",
|
|
177
|
+
"patience_counter": 3
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
8. **Decide next step** → back to step 1
|
|
182
|
+
|
|
183
|
+
### Phase 3: Refinement (if time allows)
|
|
184
|
+
|
|
185
|
+
If the search converged and there's still time budget:
|
|
186
|
+
|
|
187
|
+
1. **Local perturbation**: try ±1 step on each parameter from the best point
|
|
188
|
+
2. **Sensitivity analysis**: which parameters can be relaxed without hurting the metric?
|
|
189
|
+
3. **Constraint boundary**: if a constraint is nearly binding, explore near-feasible points
|
|
190
|
+
|
|
191
|
+
### Phase 4: Report
|
|
192
|
+
|
|
193
|
+
Write `dse_results/DSE_REPORT.md`:
|
|
194
|
+
|
|
195
|
+
```markdown
|
|
196
|
+
# Design Space Exploration Report
|
|
197
|
+
|
|
198
|
+
**Task**: [description]
|
|
199
|
+
**Date**: [start] → [end]
|
|
200
|
+
**Total iterations**: N
|
|
201
|
+
**Wall-clock time**: X hours Y minutes
|
|
202
|
+
|
|
203
|
+
## Objective
|
|
204
|
+
- **Metric**: [what was optimized]
|
|
205
|
+
- **Direction**: minimize / maximize
|
|
206
|
+
- **Baseline**: [value]
|
|
207
|
+
- **Best found**: [value] ([improvement]% better than baseline)
|
|
208
|
+
|
|
209
|
+
## Best Configuration
|
|
210
|
+
| Parameter | Baseline | Best |
|
|
211
|
+
|-----------|----------|------|
|
|
212
|
+
| param1 | default | best_val |
|
|
213
|
+
| param2 | default | best_val |
|
|
214
|
+
| ... | ... | ... |
|
|
215
|
+
|
|
216
|
+
## Search Trajectory
|
|
217
|
+
| Iteration | param1 | param2 | ... | Metric | Notes |
|
|
218
|
+
|-----------|--------|--------|-----|--------|-------|
|
|
219
|
+
| 0 (baseline) | ... | ... | ... | ... | baseline |
|
|
220
|
+
| 1 | ... | ... | ... | ... | initial sweep |
|
|
221
|
+
| ... | ... | ... | ... | ... | ... |
|
|
222
|
+
| N (best) | ... | ... | ... | ... | ★ best |
|
|
223
|
+
|
|
224
|
+
## Parameter Sensitivity
|
|
225
|
+
- **param1**: [high/medium/low impact] — [brief explanation]
|
|
226
|
+
- **param2**: [high/medium/low impact] — [brief explanation]
|
|
227
|
+
|
|
228
|
+
## Pareto Frontier (if multi-objective)
|
|
229
|
+
[Table or description of non-dominated points]
|
|
230
|
+
|
|
231
|
+
## Stopping Reason
|
|
232
|
+
[timeout / max_iterations / patience / success_criteria_met]
|
|
233
|
+
|
|
234
|
+
## Recommendations
|
|
235
|
+
- [actionable insights from the exploration]
|
|
236
|
+
- [which parameters matter most]
|
|
237
|
+
- [suggested follow-up explorations]
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Also generate a summary plot if matplotlib is available:
|
|
241
|
+
- Convergence curve (metric vs iteration)
|
|
242
|
+
- Parameter sensitivity bar chart
|
|
243
|
+
- Pareto frontier scatter (if multi-objective)
|
|
244
|
+
|
|
245
|
+
## State Recovery
|
|
246
|
+
|
|
247
|
+
If the context window compacts mid-run, the loop recovers from `DSE_STATE.json` + `dse_log.csv`:
|
|
248
|
+
|
|
249
|
+
1. Read `DSE_STATE.json` for current iteration, best params, patience counter
|
|
250
|
+
2. Read `dse_log.csv` for full history
|
|
251
|
+
3. Resume from next iteration
|
|
252
|
+
|
|
253
|
+
## Key Rules
|
|
254
|
+
|
|
255
|
+
- Work AUTONOMOUSLY — do not ask the user for permission at each iteration
|
|
256
|
+
- **Every run must be logged** — even failed runs, constraint violations, errors. The log is the ground truth.
|
|
257
|
+
- **Never re-run an identical configuration** — check `dse_log.csv` before each run
|
|
258
|
+
- **Respect the timeout** — check elapsed time before starting a new iteration. If the next run is likely to exceed the timeout, stop and report.
|
|
259
|
+
- **Parse metrics programmatically** — write a parsing script, don't eyeball logs
|
|
260
|
+
- **Keep raw outputs** — save each run's full output in `dse_results/outputs/iter_N/`
|
|
261
|
+
- **Constraint violations are not improvements** — a design point that violates constraints is never "best", regardless of the metric
|
|
262
|
+
- If a run crashes, log the error, skip that point, and continue with the next
|
|
263
|
+
- If the same crash repeats 3 times with different configs, stop and report the issue
|
|
264
|
+
|
|
265
|
+
## Example Invocations
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
# Minimal — just name the parameters, let the agent figure out ranges
|
|
269
|
+
/dse-loop "Run gem5 mcf benchmark. Tune: L1D_SIZE, L2_SIZE, ROB_ENTRIES. Objective: maximize IPC. Timeout: 3h"
|
|
270
|
+
|
|
271
|
+
# Partial — some ranges given, some not
|
|
272
|
+
/dse-loop "Run make synth. Tune: CLOCK_PERIOD [5ns, 4ns, 3ns, 2ns], FLATTEN, ABC_SCRIPT. Objective: minimize area at timing closure. Timeout: 1h"
|
|
273
|
+
|
|
274
|
+
# Fully specified — explicit ranges for everything
|
|
275
|
+
/dse-loop "Simulate processor with FIFO_DEPTH [4,8,16,32], ISSUE_WIDTH [1,2,4], PREFETCH [on,off]. Run: make sim. Objective: max throughput/area. Timeout: 2h"
|
|
276
|
+
|
|
277
|
+
# Real-world: PDAG-SFA formal verification tuning
|
|
278
|
+
/dse-loop "Run python run_bmc.py. Tune: BMC_DEPTH, ENGINE, TIMEOUT_PER_PROP. Objective: maximize properties proved. Timeout: 2h"
|
|
279
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "auto-claude/analyze-results"
|
|
3
|
+
description: "Analyze ML experiment results, compute statistics, generate comparison tables and insights. Use when user says \"analyze results\", \"compare\", or needs to interpret experimental data."
|
|
4
|
+
argument-hint: ["results-path-or-description"]
|
|
5
|
+
allowed-tools: "Bash(*), Read, Grep, Glob, Write, Edit, Agent"
|
|
6
|
+
metadata:
|
|
7
|
+
category: "data-analysis/statistics"
|
|
8
|
+
---
|
|
9
|
+
# Analyze Experiment Results
|
|
10
|
+
|
|
11
|
+
Analyze: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### Step 1: Locate Results
|
|
16
|
+
Find all relevant JSON/CSV result files:
|
|
17
|
+
- Check `figures/`, `results/`, or project-specific output directories
|
|
18
|
+
- Parse JSON results into structured data
|
|
19
|
+
|
|
20
|
+
### Step 2: Build Comparison Table
|
|
21
|
+
Organize results by:
|
|
22
|
+
- **Independent variables**: model type, hyperparameters, data config
|
|
23
|
+
- **Dependent variables**: primary metric (e.g., perplexity, accuracy, loss), secondary metrics
|
|
24
|
+
- **Delta vs baseline**: always compute relative improvement
|
|
25
|
+
|
|
26
|
+
### Step 3: Statistical Analysis
|
|
27
|
+
- If multiple seeds: report mean +/- std, check reproducibility
|
|
28
|
+
- If sweeping a parameter: identify trends (monotonic, U-shaped, plateau)
|
|
29
|
+
- Flag outliers or suspicious results
|
|
30
|
+
|
|
31
|
+
### Step 4: Generate Insights
|
|
32
|
+
For each finding, structure as:
|
|
33
|
+
1. **Observation**: what the data shows (with numbers)
|
|
34
|
+
2. **Interpretation**: why this might be happening
|
|
35
|
+
3. **Implication**: what this means for the research question
|
|
36
|
+
4. **Next step**: what experiment would test the interpretation
|
|
37
|
+
|
|
38
|
+
### Step 5: Update Documentation
|
|
39
|
+
If findings are significant:
|
|
40
|
+
- Propose updates to project notes or experiment reports
|
|
41
|
+
- Draft a concise finding statement (1-2 sentences)
|
|
42
|
+
|
|
43
|
+
## Output Format
|
|
44
|
+
Always include:
|
|
45
|
+
1. Raw data table
|
|
46
|
+
2. Key findings (numbered, concise)
|
|
47
|
+
3. Suggested next experiments (if any)
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "auto-claude/paper-figure"
|
|
3
|
+
description: "Generate publication-quality figures and tables from experiment results. Use when user says \"画图\", \"作图\", \"generate figures\", \"paper figures\", or needs plots for a paper."
|
|
4
|
+
argument-hint: ["figure-plan-or-data-path"]
|
|
5
|
+
allowed-tools: "Bash(*), Read, Write, Edit, Grep, Glob, Agent, mcp__codex__codex, mcp__codex__codex-reply"
|
|
6
|
+
metadata:
|
|
7
|
+
category: "data-analysis/visualization"
|
|
8
|
+
---
|
|
9
|
+
# Paper Figure: Publication-Quality Plots from Experiment Data
|
|
10
|
+
|
|
11
|
+
Generate all figures and tables for a paper based on: **$ARGUMENTS**
|
|
12
|
+
|
|
13
|
+
## Scope: What This Skill Can and Cannot Do
|
|
14
|
+
|
|
15
|
+
| Category | Can auto-generate? | Examples |
|
|
16
|
+
|----------|-------------------|----------|
|
|
17
|
+
| **Data-driven plots** | ✅ Yes | Line plots (training curves), bar charts (method comparison), scatter plots, heatmaps, box/violin plots |
|
|
18
|
+
| **Comparison tables** | ✅ Yes | LaTeX tables comparing prior bounds, method features, ablation results |
|
|
19
|
+
| **Multi-panel figures** | ✅ Yes | Subfigure grids combining multiple plots (e.g., 3×3 dataset × method) |
|
|
20
|
+
| **Architecture/pipeline diagrams** | ❌ No — manual | Model architecture, data flow diagrams, system overviews. At best can generate a rough TikZ skeleton, but **expect to draw these yourself** using tools like draw.io, Figma, or TikZ |
|
|
21
|
+
| **Generated image grids** | ❌ No — manual | Grids of generated samples (e.g., GAN/diffusion outputs). These come from running your model, not from this skill |
|
|
22
|
+
| **Photographs / screenshots** | ❌ No — manual | Real-world images, UI screenshots, qualitative examples |
|
|
23
|
+
|
|
24
|
+
**In practice:** For a typical ML paper, this skill handles ~60% of figures (all data plots + tables). The remaining ~40% (hero figure, architecture diagram, qualitative results) need to be created manually and placed in `figures/` before running `/paper-write`. The skill will detect these as "existing figures" and preserve them.
|
|
25
|
+
|
|
26
|
+
## Constants
|
|
27
|
+
|
|
28
|
+
- **STYLE = `publication`** — Visual style preset. Options: `publication` (default, clean for print), `poster` (larger fonts), `slide` (bold colors)
|
|
29
|
+
- **DPI = 300** — Output resolution
|
|
30
|
+
- **FORMAT = `pdf`** — Output format. Options: `pdf` (vector, best for LaTeX), `png` (raster fallback)
|
|
31
|
+
- **COLOR_PALETTE = `tab10`** — Default matplotlib color cycle. Options: `tab10`, `Set2`, `colorblind` (deuteranopia-safe)
|
|
32
|
+
- **FONT_SIZE = 10** — Base font size (matches typical conference body text)
|
|
33
|
+
- **FIG_DIR = `figures/`** — Output directory for generated figures
|
|
34
|
+
- **REVIEWER_MODEL = `gpt-5.4`** — Model used via Codex MCP for figure quality review.
|
|
35
|
+
|
|
36
|
+
## Inputs
|
|
37
|
+
|
|
38
|
+
1. **PAPER_PLAN.md** — figure plan table (from `/paper-plan`)
|
|
39
|
+
2. **Experiment data** — JSON files, CSV files, or screen logs in `figures/` or project root
|
|
40
|
+
3. **Existing figures** — any manually created figures to preserve
|
|
41
|
+
|
|
42
|
+
If no PAPER_PLAN.md exists, scan for data files and ask the user which figures to generate.
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
### Step 1: Read Figure Plan
|
|
47
|
+
|
|
48
|
+
Parse the Figure Plan table from PAPER_PLAN.md:
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
| ID | Type | Description | Data Source | Priority |
|
|
52
|
+
|----|------|-------------|-------------|----------|
|
|
53
|
+
| Fig 1 | Architecture | ... | manual | HIGH |
|
|
54
|
+
| Fig 2 | Line plot | ... | figures/exp.json | HIGH |
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Identify:
|
|
58
|
+
- Which figures can be auto-generated from data
|
|
59
|
+
- Which need manual creation (architecture diagrams, etc.)
|
|
60
|
+
- Which are comparison tables (generate as LaTeX)
|
|
61
|
+
|
|
62
|
+
### Step 2: Set Up Plotting Environment
|
|
63
|
+
|
|
64
|
+
Create a shared style configuration script:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
# paper_plot_style.py — shared across all figure scripts
|
|
68
|
+
import matplotlib.pyplot as plt
|
|
69
|
+
import matplotlib
|
|
70
|
+
matplotlib.rcParams.update({
|
|
71
|
+
'font.size': FONT_SIZE,
|
|
72
|
+
'font.family': 'serif',
|
|
73
|
+
'font.serif': ['Times New Roman', 'Times', 'DejaVu Serif'],
|
|
74
|
+
'axes.labelsize': FONT_SIZE,
|
|
75
|
+
'axes.titlesize': FONT_SIZE + 1,
|
|
76
|
+
'xtick.labelsize': FONT_SIZE - 1,
|
|
77
|
+
'ytick.labelsize': FONT_SIZE - 1,
|
|
78
|
+
'legend.fontsize': FONT_SIZE - 1,
|
|
79
|
+
'figure.dpi': DPI,
|
|
80
|
+
'savefig.dpi': DPI,
|
|
81
|
+
'savefig.bbox': 'tight',
|
|
82
|
+
'savefig.pad_inches': 0.05,
|
|
83
|
+
'axes.grid': False,
|
|
84
|
+
'axes.spines.top': False,
|
|
85
|
+
'axes.spines.right': False,
|
|
86
|
+
'text.usetex': False, # set True if LaTeX is available
|
|
87
|
+
'mathtext.fontset': 'stix',
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
# Color palette
|
|
91
|
+
COLORS = plt.cm.tab10.colors # or Set2, or colorblind-safe
|
|
92
|
+
|
|
93
|
+
def save_fig(fig, name, fmt=FORMAT):
|
|
94
|
+
"""Save figure to FIG_DIR with consistent naming."""
|
|
95
|
+
fig.savefig(f'{FIG_DIR}/{name}.{fmt}')
|
|
96
|
+
print(f'Saved: {FIG_DIR}/{name}.{fmt}')
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Step 3: Auto-Select Figure Type
|
|
100
|
+
|
|
101
|
+
Use this decision tree for data-driven figures (inspired by Imbad0202/academic-research-skills):
|
|
102
|
+
|
|
103
|
+
| Data Pattern | Recommended Type | Size |
|
|
104
|
+
|-------------|-----------------|------|
|
|
105
|
+
| X=time/steps, Y=metric | Line plot | 0.48\textwidth |
|
|
106
|
+
| Methods × 1 metric | Bar chart | 0.48\textwidth |
|
|
107
|
+
| Methods × multiple metrics | Grouped bar / radar | 0.95\textwidth |
|
|
108
|
+
| Two continuous variables | Scatter plot | 0.48\textwidth |
|
|
109
|
+
| Matrix / grid values | Heatmap | 0.48\textwidth |
|
|
110
|
+
| Distribution comparison | Box/violin plot | 0.48\textwidth |
|
|
111
|
+
| Multi-dataset results | Multi-panel (subfigure) | 0.95\textwidth |
|
|
112
|
+
| Prior work comparison | LaTeX table | — |
|
|
113
|
+
|
|
114
|
+
### Step 4: Generate Each Figure
|
|
115
|
+
|
|
116
|
+
For each figure in the plan, create a standalone Python script:
|
|
117
|
+
|
|
118
|
+
**Line plots** (training curves, scaling):
|
|
119
|
+
```python
|
|
120
|
+
# gen_fig2_training_curves.py
|
|
121
|
+
from paper_plot_style import *
|
|
122
|
+
import json
|
|
123
|
+
|
|
124
|
+
with open('figures/exp_results.json') as f:
|
|
125
|
+
data = json.load(f)
|
|
126
|
+
|
|
127
|
+
fig, ax = plt.subplots(1, 1, figsize=(5, 3.5))
|
|
128
|
+
ax.plot(data['steps'], data['fac_loss'], label='Factorized', color=COLORS[0])
|
|
129
|
+
ax.plot(data['steps'], data['crf_loss'], label='CRF-LR', color=COLORS[1])
|
|
130
|
+
ax.set_xlabel('Training Steps')
|
|
131
|
+
ax.set_ylabel('Cross-Entropy Loss')
|
|
132
|
+
ax.legend(frameon=False)
|
|
133
|
+
save_fig(fig, 'fig2_training_curves')
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Bar charts** (comparison, ablation):
|
|
137
|
+
```python
|
|
138
|
+
fig, ax = plt.subplots(1, 1, figsize=(5, 3))
|
|
139
|
+
methods = ['Baseline', 'Method A', 'Method B', 'Ours']
|
|
140
|
+
values = [82.3, 85.1, 86.7, 89.2]
|
|
141
|
+
bars = ax.bar(methods, values, color=[COLORS[i] for i in range(len(methods))])
|
|
142
|
+
ax.set_ylabel('Accuracy (%)')
|
|
143
|
+
# Add value labels on bars
|
|
144
|
+
for bar, val in zip(bars, values):
|
|
145
|
+
ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() + 0.3,
|
|
146
|
+
f'{val:.1f}', ha='center', va='bottom', fontsize=FONT_SIZE-1)
|
|
147
|
+
save_fig(fig, 'fig3_comparison')
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Comparison tables** (LaTeX, for theory papers):
|
|
151
|
+
```latex
|
|
152
|
+
\begin{table}[t]
|
|
153
|
+
\centering
|
|
154
|
+
\caption{Comparison of estimation error bounds. $n$: sample size, $D$: ambient dim, $d$: latent dim, $K$: subspaces, $n_k$: modes.}
|
|
155
|
+
\label{tab:bounds}
|
|
156
|
+
\begin{tabular}{lccc}
|
|
157
|
+
\toprule
|
|
158
|
+
Method & Rate & Depends on $D$? & Multi-modal? \\
|
|
159
|
+
\midrule
|
|
160
|
+
\citet{MinimaxOkoAS23} & $n^{-s'/D}$ & Yes (curse) & No \\
|
|
161
|
+
\citet{ScoreMatchingdistributionrecovery} & $n^{-2/d}$ & No & No \\
|
|
162
|
+
\textbf{Ours} & $\sqrt{\sum n_k d_k / n}$ & No & Yes \\
|
|
163
|
+
\bottomrule
|
|
164
|
+
\end{tabular}
|
|
165
|
+
\end{table}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Architecture/pipeline diagrams** (MANUAL — outside this skill's scope):
|
|
169
|
+
- These require manual creation using draw.io, Figma, Keynote, or TikZ
|
|
170
|
+
- This skill can generate a rough TikZ skeleton as a starting point, but **do not expect publication-quality results**
|
|
171
|
+
- If the figure already exists in `figures/`, preserve it and generate only the LaTeX `\includegraphics` snippet
|
|
172
|
+
- Flag as `[MANUAL]` in the figure plan and `latex_includes.tex`
|
|
173
|
+
|
|
174
|
+
### Step 5: Run All Scripts
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Run all figure generation scripts
|
|
178
|
+
for script in gen_fig*.py; do
|
|
179
|
+
python "$script"
|
|
180
|
+
done
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Verify all output files exist and are non-empty.
|
|
184
|
+
|
|
185
|
+
### Step 6: Generate LaTeX Include Snippets
|
|
186
|
+
|
|
187
|
+
For each figure, output the LaTeX code to include it:
|
|
188
|
+
|
|
189
|
+
```latex
|
|
190
|
+
% === Fig 2: Training Curves ===
|
|
191
|
+
\begin{figure}[t]
|
|
192
|
+
\centering
|
|
193
|
+
\includegraphics[width=0.48\textwidth]{figures/fig2_training_curves.pdf}
|
|
194
|
+
\caption{Training curves comparing factorized and CRF-LR denoising.}
|
|
195
|
+
\label{fig:training_curves}
|
|
196
|
+
\end{figure}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Save all snippets to `figures/latex_includes.tex` for easy copy-paste into the paper.
|
|
200
|
+
|
|
201
|
+
### Step 7: Figure Quality Review with REVIEWER_MODEL
|
|
202
|
+
|
|
203
|
+
Send figure descriptions and captions to GPT-5.4 for review:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
mcp__codex__codex:
|
|
207
|
+
model: gpt-5.4
|
|
208
|
+
config: {"model_reasoning_effort": "xhigh"}
|
|
209
|
+
prompt: |
|
|
210
|
+
Review these figure/table plans for a [VENUE] submission.
|
|
211
|
+
|
|
212
|
+
For each figure:
|
|
213
|
+
1. Is the caption informative and self-contained?
|
|
214
|
+
2. Does the figure type match the data being shown?
|
|
215
|
+
3. Is the comparison fair and clear?
|
|
216
|
+
4. Any missing baselines or ablations?
|
|
217
|
+
5. Would a different visualization be more effective?
|
|
218
|
+
|
|
219
|
+
[list all figures with captions and descriptions]
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Step 8: Quality Checklist
|
|
223
|
+
|
|
224
|
+
Before finishing, verify each figure (from pedrohcgs/claude-code-my-workflow):
|
|
225
|
+
|
|
226
|
+
- [ ] Font size readable at printed paper size (not too small)
|
|
227
|
+
- [ ] Colors distinguishable in grayscale (print-friendly)
|
|
228
|
+
- [ ] **No title inside figures** — titles go only in LaTeX `\caption{}` (from pedrohcgs)
|
|
229
|
+
- [ ] Legend does not overlap data
|
|
230
|
+
- [ ] Axis labels have units where applicable
|
|
231
|
+
- [ ] Axis labels are publication-quality (not variable names like `emp_rate`)
|
|
232
|
+
- [ ] Figure width fits single column (0.48\textwidth) or full width (0.95\textwidth)
|
|
233
|
+
- [ ] PDF output is vector (not rasterized text)
|
|
234
|
+
- [ ] No matplotlib default title (remove `plt.title` for publications)
|
|
235
|
+
- [ ] Serif font matches paper body text (Times / Computer Modern)
|
|
236
|
+
- [ ] Colorblind-accessible (if using colorblind palette)
|
|
237
|
+
|
|
238
|
+
## Output
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
figures/
|
|
242
|
+
├── paper_plot_style.py # shared style config
|
|
243
|
+
├── gen_fig1_architecture.py # per-figure scripts
|
|
244
|
+
├── gen_fig2_training_curves.py
|
|
245
|
+
├── gen_fig3_comparison.py
|
|
246
|
+
├── fig1_architecture.pdf # generated figures
|
|
247
|
+
├── fig2_training_curves.pdf
|
|
248
|
+
├── fig3_comparison.pdf
|
|
249
|
+
├── latex_includes.tex # LaTeX snippets for all figures
|
|
250
|
+
└── TABLE_*.tex # standalone table LaTeX files
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Key Rules
|
|
254
|
+
|
|
255
|
+
- **Every figure must be reproducible** — save the generation script alongside the output
|
|
256
|
+
- **Do NOT hardcode data** — always read from JSON/CSV files
|
|
257
|
+
- **Use vector format (PDF)** for all plots — PNG only as fallback
|
|
258
|
+
- **No decorative elements** — no background colors, no 3D effects, no chart junk
|
|
259
|
+
- **Consistent style across all figures** — same fonts, colors, line widths
|
|
260
|
+
- **Colorblind-safe** — verify with https://davidmathlogic.com/colorblind/ if needed
|
|
261
|
+
- **One script per figure** — easy to re-run individual figures when data changes
|
|
262
|
+
- **No titles inside figures** — captions are in LaTeX only
|
|
263
|
+
- **Comparison tables count as figures** — generate them as standalone .tex files
|
|
264
|
+
|
|
265
|
+
## Figure Type Reference
|
|
266
|
+
|
|
267
|
+
| Type | When to Use | Typical Size |
|
|
268
|
+
|------|------------|--------------|
|
|
269
|
+
| Line plot | Training curves, scaling trends | 0.48\textwidth |
|
|
270
|
+
| Bar chart | Method comparison, ablation | 0.48\textwidth |
|
|
271
|
+
| Grouped bar | Multi-metric comparison | 0.95\textwidth |
|
|
272
|
+
| Scatter plot | Correlation analysis | 0.48\textwidth |
|
|
273
|
+
| Heatmap | Attention, confusion matrix | 0.48\textwidth |
|
|
274
|
+
| Box/violin | Distribution comparison | 0.48\textwidth |
|
|
275
|
+
| Architecture | System overview | 0.95\textwidth |
|
|
276
|
+
| Multi-panel | Combined results (subfigures) | 0.95\textwidth |
|
|
277
|
+
| Comparison table | Prior bounds vs. ours (theory) | full width |
|
|
278
|
+
|
|
279
|
+
## Acknowledgements
|
|
280
|
+
|
|
281
|
+
Design pattern (type × style matrix) inspired by [baoyu-skills](https://github.com/jimliu/baoyu-skills). Publication style defaults and figure rules from [pedrohcgs/claude-code-my-workflow](https://github.com/pedrohcgs/claude-code-my-workflow). Visualization decision tree from [Imbad0202/academic-research-skills](https://github.com/Imbad0202/academic-research-skills).
|