CLAUDE CODE MARKETPLACES

fledgling

Fledgling gives you structured, token-efficient access to the codebase you're working in. Instead of reading raw files and guessing at structure, you get targeted tools backed by SQL macros and real parsers (AST for code, markdown parser for docs, git for history).

npx skills add https://github.com/teaguesterling/fledgling --skill fledgling
SKILL.md

Fledgling Skill Guide

Fledgling gives you structured, token-efficient access to the codebase you're working in. Instead of reading raw files and guessing at structure, you get targeted tools backed by SQL macros and real parsers (AST for code, markdown parser for docs, git for history).

Quick Reference

Tools

ToolPurposeKey params
ReadLinesRead file content with line ranges, context, and match filteringfile_path, lines, match, commit
FindDefinitionsAST-based search for functions, classes, variablesfile_pattern, name_pattern
FindCodeCSS selector search: .func, #name, :has(...), ::callersfile_pattern, selector
ViewCodeView source matched by CSS selector with context linesfile_pattern, selector, context
SelectCodeRender selector matches as markdown: file:range headings + full source blockssource, selector
CodeStructureTop-level overview: what's defined in each filefile_pattern
ExploreProjectFirst-contact briefing: languages, structure, docs, recent activityroot, code_pattern, doc_pattern
InvestigateSymbolDeep dive: definitions, callers, call sites for a symbolname, file_pattern
ReviewChangesChange review: files and functions ranked by complexityfrom_rev, to_rev, file_pattern
SearchProjectMulti-source search across definitions, calls, and docspattern, file_pattern
MDOverviewBrowse all docs with keyword/regex searchfile_pattern, search
MDSectionRead a markdown section by IDfile_path, section_id
GitDiffSummaryFile-level change summary between revisionsfrom_rev, to_rev
GitShowFile content at a specific git revisionfile, rev
HelpThis guide (no args = outline, section_id = details)section
ChatSessionsBrowse conversation sessionsproject, days, limit
ChatSearchSearch across conversation messagesquery, role
ChatToolUsageTool usage frequencyproject, days
ChatDetailDeep view of a single sessionsession_id
SearchContentBM25 full-text search over docs + code (requires rebuild first)query, kind, extractor, limit
SearchDocsBM25 search over markdown sectionsquery, limit
SearchCodeBM25 search over code (definition/comment/string)query, kind, limit
FtsStatsDiagnostic: counts per extractor/kind in the FTS index

Query-Only Macros

These macros are available via the query tool. They provide the full power of Fledgling's SQL composability — you can join, filter, and aggregate across them.

MacroPurposeExample
list_files(pattern)Find files by globSELECT * FROM list_files('src/**/*.py')
project_overview(root)File counts by languageSELECT * FROM project_overview('.')
read_as_table(path, limit)Preview CSV/JSON/Parquet as tableSELECT * FROM read_as_table('data.csv')
find_calls(pattern, name)Find function call sitesSELECT * FROM find_calls('src/**/*.py', 'connect')
find_imports(pattern)Find import statementsSELECT * FROM find_imports('src/**/*.py')
complexity_hotspots(pattern, n)Functions ranked by cyclomatic complexitySELECT * FROM complexity_hotspots('src/**/*.py', 10)
function_callers(pattern, name)Who calls a function?SELECT * FROM function_callers('src/**/*.py', 'validate')
module_dependencies(pattern, pkg)Internal import graph with fan-inSELECT * FROM module_dependencies('src/**/*.py', 'myapp')
doc_outline(pattern, max_level)Markdown table of contentsSELECT * FROM doc_outline('docs/**/*.md')
recent_changes(n, repo)Commit historySELECT * FROM recent_changes(10)
branch_list(repo)List branchesSELECT * FROM branch_list()
tag_list(repo)List tagsSELECT * FROM tag_list()
file_changes(from, to, repo)Files changed between revisionsSELECT * FROM file_changes('HEAD~3', 'HEAD')
file_diff(file, from, to, repo)Line-level unified diffSELECT * FROM file_diff('src/main.py', 'HEAD~1', 'HEAD')
working_tree_status(repo)Untracked/deleted filesSELECT * FROM working_tree_status()
structural_diff(file, from, to)Semantic diff: added/removed/modified definitionsSELECT * FROM structural_diff('src/main.py', 'HEAD~1', 'HEAD')
changed_function_summary(from, to, pattern)Functions in changed files, ranked by cyclomatic complexitySELECT * FROM changed_function_summary('HEAD~5', 'HEAD', 'src/**/*.py')

Tools

ReadLines

Read file content with precision. Replaces cat/head/tail with structured output.

Returns: line_number, content

ReadLines(file_path="src/main.py")                    # whole file
ReadLines(file_path="src/main.py", lines="10-25")     # line range
ReadLines(file_path="src/main.py", lines="42", ctx="5")  # line 42 +/- 5 lines
ReadLines(file_path="src/main.py", match="import")    # only matching lines
ReadLines(file_path="src/main.py", lines="1-50", match="def")  # combined
ReadLines(file_path="src/main.py", commit="HEAD~1")   # previous version

FindDefinitions

Find where things are defined: functions, classes, methods, variables. AST-based, not text matching.

Returns: file_path, name, kind, start_line, end_line, signature

FindDefinitions(file_pattern="src/**/*.py")                # all definitions
FindDefinitions(file_pattern="src/**/*.py", name_pattern="parse%")  # names starting with "parse"
FindDefinitions(file_pattern="lib/*.ts", name_pattern="%Handler")   # names ending with "Handler"

The name_pattern uses SQL LIKE wildcards: % matches any sequence, _ matches one character.

CodeStructure

High-level overview of what's defined in files, with line counts. Good first step to understand unfamiliar code.

Returns: file_path, name, kind, start_line, end_line, line_count

CodeStructure(file_pattern="src/**/*.py")
CodeStructure(file_pattern="lib/auth.ts")

MDSection

Read a specific markdown section by ID. Use doc_outline() via the query tool to discover section IDs first.

Returns: section_id, title, level, content, start_line, end_line

MDSection(file_path="docs/guide.md", section_id="installation")
MDSection(file_path="README.md", section_id="getting-started")

GitDiffSummary

File-level summary of changes between two git revisions. For function-level analysis, use structural_diff() or changed_function_summary() via the query tool.

Returns: file_path, status, old_size, new_size

GitDiffSummary(from_rev="HEAD~1", to_rev="HEAD")
GitDiffSummary(from_rev="main", to_rev="feature-branch")

GitShow

Show file content at a specific git revision. Replaces git show rev:path.

Returns: file_path, ref, size_bytes, content

GitShow(file="README.md", rev="HEAD~1")
GitShow(file="sql/repo.sql", rev="main")

Help

This guide. Call with no args to see the section outline, or pass a section ID for details.

Help()                              # outline
Help(section="workflows")           # specific section

Code Intelligence

All code tools use AST parsing (via sitting_duck), not text matching. They work across 30 languages including Python, JavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, and more.

Use ast_supported_languages() via the query tool for the live list.

Composing Macros

The real power of Fledgling is composing macros via the query tool. Examples:

-- Complex functions in recently changed files
SELECT h.file_path, h.name, h.cyclomatic, h.lines
FROM complexity_hotspots('src/**/*.py') h
WHERE h.file_path IN (
    SELECT file_path FROM changed_function_summary('main', 'HEAD', 'src/**/*.py')
);

-- Module dependency fan-in (what's the most-imported module?)
SELECT target_module, fan_in
FROM module_dependencies('src/**/*.py', 'myapp')
ORDER BY fan_in DESC;

-- Functions over 20 lines with high complexity
SELECT file_path, name, cyclomatic, lines
FROM complexity_hotspots('src/**/*.py', 100)
WHERE cyclomatic > 10 AND lines > 20;

Workflows

Explore an Unfamiliar Codebase

Quick (one call): ExploreProject() — returns languages, top-complexity definitions, doc outline, and recent git activity in one structured result.

Detailed (step-by-step):

  1. CodeStructure(file_pattern="src/**/*.py") — see what's defined where
  2. ReadLines(file_path="src/main.py") — read key files
  3. MDOverview(file_pattern="*.md") — find docs
  4. MDSection(file_path="README.md", section_id="...") — read relevant docs

Understand a Function

Quick (one call): InvestigateSymbol(name="my_func") — returns definitions, callers, and call sites in one result.

Detailed (step-by-step):

  1. FindDefinitions(file_pattern="src/**/*.py", name_pattern="my_func%") — find it
  2. ReadLines(file_path="src/module.py", lines="42-80") — read implementation
  3. Use query tool: SELECT * FROM function_callers('src/**/*.py', 'my_func') — who calls it?

Review Recent Changes

Quick (one call): ReviewChanges(from_rev="HEAD~3", to_rev="HEAD") — returns changed files and functions ranked by complexity.

Detailed (step-by-step):

  1. GitDiffSummary(from_rev="HEAD~3", to_rev="HEAD") — which files changed
  2. Use query tool: SELECT * FROM changed_function_summary('HEAD~3', 'HEAD', 'src/**/*.py') — what functions are affected
  3. Use query tool: SELECT * FROM complexity_hotspots('src/**/*.py', 10) — what's risky
  4. ReadLines(file_path="src/changed.py", lines="42-80") — read the changes

Search Across Sources

Quick (one call): SearchProject(pattern="parse%") — searches definitions, call sites, and docs simultaneously.

View Code by Selector

Use CSS selectors to find and view code structurally:

FindCode(file_pattern="src/**/*.py", selector=".func#validate")
ViewCode(file_pattern="src/**/*.py", selector=".func:has(.call#execute)")
SelectCode(source="src/**/*.py", selector=".class > .func")

Selector syntax: .func, .class, .call, .import, #name, :has(child), :not(...), ::callers, ::callees, A > B (direct child), A ~ B (sibling).

Analyze Architecture

  1. Use query tool: SELECT * FROM module_dependencies('src/**/*.py', 'myapp') — import graph
  2. CodeStructure(file_pattern="src/core/*.py") — core module structure
  3. Use query tool: SELECT * FROM complexity_hotspots('src/**/*.py', 20) — complexity hotspots

Macro Reference

All macros are available via the query tool.

Files

MacroSignature
list_files(pattern, commit := NULL)
read_source(file_path, lines := NULL, ctx := 0, match := NULL)
read_source_batch(file_pattern, lines := NULL, ctx := 0)
read_context(file_path, center_line, ctx := 5)
file_line_count(file_pattern)
project_overview(root := '.')
read_as_table(file_path, lim := 100)

Code

MacroSignature
find_definitions(file_pattern, name_pattern := '%')
find_calls(file_pattern, name_pattern := '%')
find_imports(file_pattern)
find_code(file_pattern, selector, lang := NULL)
find_code_grep(file_pattern, selector, lang := NULL)
view_code(file_pattern, selector, lang := NULL, ctx := 0)
view_code_text(file_pattern, selector, lang := NULL, ctx := 0)
code_structure(file_pattern)
find_class_members(file_path, class_node_id)
complexity_hotspots(file_pattern, n := 20)
function_callers(file_pattern, func_name)
module_dependencies(file_pattern, package_prefix)

Structural Analysis

MacroSignature
structural_diff(file, from_rev, to_rev, repo := '.')
changed_function_summary(from_rev, to_rev, file_pattern, repo := '.')

Workflows

MacroSignature
explore_query(root := '.', code_pattern := '**/*.py', doc_pattern := 'docs/**/*.md', top_n := 20, recent_n := 10)
investigate_query(name, file_pattern := '**/*.py')
review_query(from_rev := 'HEAD~1', to_rev := 'HEAD', file_pattern := '**/*.py', repo := '.', top_n := 20)
search_query(pattern, file_pattern := '**/*.py', doc_pattern := 'docs/**/*.md', top_n := 50)
pss_render(source, selector)
ast_select_render(source, selector)

Docs

MacroSignature
doc_outline(file_pattern, max_lvl := 3)
read_doc_section(file_path, target_id)
find_code_examples(file_pattern, lang := NULL)
doc_stats(file_pattern)

Git

MacroSignature
recent_changes(n := 10, repo := '.')
branch_list(repo := '.')
tag_list(repo := '.')
repo_files(rev := 'HEAD', repo := '.')
file_at_version(file, rev, repo := '.')
file_changes(from_rev, to_rev, repo := '.')
file_diff(file, from_rev, to_rev, repo := '.')
working_tree_status(repo := '.')

Conversations

MacroSignature
sessions()
messages()
content_blocks()
tool_calls()
tool_results()
token_usage()
tool_frequency()
bash_commands()
session_summary()
model_usage()
search_messages(search_term)
search_tool_inputs(search_term)

Help

MacroSignature
help(target_id := NULL)

Tips

Supported Languages

Use ast_supported_languages() via the query tool to check the live list of languages supported by the code intelligence tools.

Glob Patterns

  • * matches within a directory: src/*.py
  • ** matches across directories: src/**/*.py
  • Combine extensions: src/**/*.{py,ts}

Path Handling

  • Paths are resolved relative to the project root
  • Use absolute paths when outside the project
  • Git mode paths are always repo-relative
  • The sandbox restricts filesystem access to the project directory; use dedicated tools instead of raw SQL for file operations

Discovering Macro Schemas

Use the describe tool to inspect what columns a macro returns:

describe(query="SELECT * FROM complexity_hotspots('test', 1)")

This reveals column names and types, making it easier to compose macros via joins.

Data File Formats

read_as_table(path) auto-detects format by extension:

ExtensionReaderBuilt-in?
.csv, .tsvread_csv_autoYes
.json, .jsonlread_json_autoYes
.parquet, .pqread_parquetYes

Unsupported extensions fall back to CSV. For other formats, use the query tool with DuckDB's native readers directly (e.g., SELECT * FROM 'data.xlsx' if the spatial extension is installed).

Token Efficiency

  • Use CodeStructure first to understand what's in a file before reading it
  • Use FindDefinitions with name_pattern to narrow results
  • Use FindCode with CSS selectors for targeted structural searches (.call#execute, .import, :has(...))
  • Use ReadLines with lines and match to read only what you need
  • Use doc_outline() via query before MDSection to find the right section
Installs0
GitHub Stars4
LanguagePython
AddedJun 10, 2026
View on GitHub