Discover important function

From UCSB-NLP-Chang/Skill-Usage · View interactive version

Discover important function is an AI agent skill from the GitHub repository UCSB-NLP-Chang/Skill-Usage. When given a project codebase, this skill observes the important functions in the codebase for future action.

How to use this skill

Skill file

Fuzz Target Localizer

Purpose

This skill helps an agent quickly narrow a Python repository down to a small set of high-value fuzz targets. It produces:

When to use

Use this skill when the user asks to:

Do not use this skill when the user primarily wants to fix a specific bug,

refactor code, or implement a harness immediately

(unless they explicitly ask for target selection first).

Inputs expected from the environment

The agent should assume access to:

Preferred repository listing command:

If tree is not available, fall back to a recursive listing via other standard shell tooling.

Outputs

Produce result:

A report in any format with the following information: - Localize important files - Localize important functions - Summarize existing unit tests - Decide function under test for fuzzing

This file should be placed in the root of the repository as APIs.txt,

which servers as the guidelines for future fuzzing harness implementation.

Guardrails


Localize important files

Goal

Produce a ranked list of files that are most likely to contain fuzz-worthy logic: parsing, decoding, deserialization, validation, protocol handling, file/network boundaries, or native bindings.

Procedure

  1. Build a repository map
  1. Exclude low-value areas
  1. Score files using explainable heuristics

Assign a file a higher score when it matches more of these indicators:

  1. Rank and select

Output format

For each file:


Localize important functions

Goal

From the important files, identify and rank functions or methods that are strong fuzz targets while minimizing full-body reading until needed.

Approach 1: AST-based header and docstring scan

For each localized Python file, parse it using Python’s ast module and extract only:

Do not read full function bodies during the initial pass unless needed for disambiguation or final selection.

Procedure

  1. Build per-file declarations via AST
  1. Generate an initial candidate set using headers and docstrings

Prioritize functions/methods that:

  1. Use tests to refine candidate selection early
  1. Confirm with targeted reading only for top candidates

For the top candidates (typically 10–20), read the full function bodies and capture:

  1. Rank and shortlist

Rank candidates using an explainable rubric:

Output format

For each function/method:

Approach 2: Scanning all important files yourself

For each localized Python file, read the file contents directly to extract:

This approach reads complete file contents, allowing for deeper analysis at the cost of higher token usage.

Procedure

  1. Read important files sequentially
  1. Generate an initial candidate set using full source analysis

Prioritize functions/methods that:

  1. Analyze implementation details from full bodies

For each candidate function, inspect the body for:

  1. Use tests to refine candidate selection
  1. Rank and shortlist

Rank candidates using an explainable rubric:

Output format

For each function/method:


Summarize existing unit tests

Goal

Summarize what is already tested, infer test oracles, and identify gaps that fuzzing can complement.

Hard requirement

Always inspect and incorporate existing tests in the repository when:

Procedure

  1. Inventory tests
  1. Summarize test intent

For each test module:

  1. Infer oracles and properties

Common fuzz-friendly oracles include:

  1. Identify coverage gaps

Output format


Decide function under test for fuzzing

Goal

Select a final set of FUTs (typically 1–5) and produce a structured "note to self" for each FUT so the agent can proceed to harness implementation, corpus seeding, and fuzz execution.

Selection criteria

Prefer FUTs that maximize:

Explicitly weigh:

Required "note to self" template

For each selected FUT, produce exactly this structure:

Fuzzing Target Note

1.

2.

3.

4.

Output format


Final JSON block

At the end of the report, include a JSON object with:

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.