System profile

From FOURTEEN1416/academic-agent-toolkit · View interactive version

System profile is an AI agent skill from the GitHub repository FOURTEEN1416/academic-agent-toolkit. Profile a target (script, process, GPU, memory, interconnect) for performance analysis. Use when user says \"profile\", \"benchmark\", \"bottleneck\", or wants performance analysis.

How to use this skill

Skill file

System Profile

Profile the specified target and summarize the results. Target: $ARGUMENTS

Instructions

You are a profiling assistant. Based on the user's target, choose appropriate profiling strategies, including writing instrumentation code when needed, then run profiling, analyze results, and produce a summary.

Step 1: Determine the profiling target

Parse $ARGUMENTS to understand what to profile. Examples:

If $ARGUMENTS is empty or unclear, ask the user.

Step 2: Choose profiling methods

Select from external tools and/or code instrumentation as appropriate. Don't limit yourself to the examples below — use whatever makes sense for the target.

External tools (check availability first):

Code instrumentation — when external tools are insufficient, write and insert profiling code into the target. Typical scenarios:

Design the instrumentation based on what you observe in the code — don't use a fixed template.

Step 3: Key dimensions to investigate

Depending on the target, focus on some or all of these:

CPU overhead

Memory overhead

Interconnect & communication

GPU compute

Step 4: Instrumentation guidelines

When inserting code into the target:

  1. Read and understand the target code first
  2. Prefer wrapping (decorator, context manager, standalone runner) over inline edits
  3. If inline edits are necessary, mark them clearly (e.g., # [PROFILE] comments)
  4. Minimize observer effect — don't instrument tight inner loops; sample instead
  5. Collect results into a structured log, don't scatter print statements

Step 5: Run profiling

  1. Check available tools and hardware topology
  2. Run the chosen methods, capture all output
  3. Save artifacts (flamegraphs, traces, logs) to ./profile_output/

Step 6: Produce the report

Part A — Profiling results (structured tables by dimension, as applicable):

Part B — Instrumentation changelog (MANDATORY):

List every file that was modified or created for profiling purposes:

| File | Change type | What was added/modified | Line(s) |

|------|-------------|------------------------|---------|

| ... | modified | ... | ... |

| ... | created | ... | — |

This allows the user to review and revert all instrumentation changes.

Offer to clean up (remove all instrumentation) when the user is done.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.