Skip to content

Instantly share code, notes, and snippets.

@birkin
Last active April 19, 2026 01:11
Show Gist options
  • Select an option

  • Save birkin/ba1c49418792fe6d9cd5585f4779cf31 to your computer and use it in GitHub Desktop.

Select an option

Save birkin/ba1c49418792fe6d9cd5585f4779cf31 to your computer and use it in GitHub Desktop.
agent-summary-docs chatgpt-5.4-medium thoughts

Repo Summary Doc Possibilities

(2026-apr-18-sat; chatgpt-5.4-medium; birkin; see birkin-prompt at bottom)

Purpose

The goal is not merely to document each repo for a human reader.

The goal is to let an agent answer cross-repo questions efficiently, especially questions like:

  • where a field enters a system
  • where it is transformed
  • where it is indexed
  • where it is exposed by an API
  • where it is rendered in a UI
  • what adjacent systems are likely to break if that field changes

That means the best summary artifact is not a single prose-only document and not a single machine-only document.

The best default is a small set of complementary files:

  1. a human-readable overview file
  2. a compact structured index file
  3. optionally, for larger repos, one or two focused flow maps

Recommendation

For each repo, create these files:

1. AGENT_SUMMARY.md

This should be the primary entry point.

Why this is useful:

  • easy for a human to read and maintain
  • easy for an agent to skim quickly
  • can capture nuance, caveats, and "this looks like the right file but actually is not" notes
  • can include links to the exact files and directories that matter

This file should be concise, probably 3-8 screens, not a full code tour.

Suggested sections:

  • Repo purpose
  • Runtime / framework / important dependencies
  • Major apps / modules
  • Main entry points
  • Data flow overview
  • External dependencies
  • Cross-repo touchpoints
  • Important models / concepts
  • Search landmarks
  • Tests and verification notes
  • Known traps / misleading areas

2. AGENT_INDEX.yaml

This should be the machine-oriented companion file.

Why this is useful:

  • gives stable landmarks without re-reading a large amount of prose
  • supports targeted follow-up inspection
  • captures code locations in a format that is easy to scan or update
  • is much more maintainable than a giant function-by-function JSON dump

I would prefer YAML over JSON here because:

  • humans can edit it more comfortably
  • comments are easier to preserve conceptually
  • it is still structured enough for agent use

This file should not try to catalog every function or method. That would become stale quickly and would cost too much to maintain.

Instead, it should catalog:

  • important directories
  • important modules
  • key models
  • key views / endpoints / commands
  • important templates
  • important settings
  • inbound dependencies
  • outbound dependencies
  • known flow paths
  • search hints

3. Optional focused flow files

For large or cross-cutting repos, add files such as:

  • FLOW__ingest.md
  • FLOW__search_indexing.md
  • FLOW__display_rendering.md
  • FLOW__auth_and_permissions.md

These are worth having when a repo has a few especially important internal paths that repeatedly matter.

For example:

  • bdr_workshop_project likely benefits from an ingest-focused flow file
  • bdr_apis_project likely benefits from an API/search/Solr flow file
  • bdr_studio_project likely benefits from a display/search/rendering flow file

These flow files should be short and path-oriented:

  • trigger
  • entry point(s)
  • transformation steps
  • external calls
  • persistence / indexing effects
  • templates / serializers / responses
  • likely change points

What Not To Do

Not ideal: prose only

A single markdown summary is better than nothing, but it will still force extra searching for concrete file targets.

Not ideal: giant JSON of functions and methods

This sounds attractive, but in practice it is too expensive to maintain and often misses the architectural point. Cross-repo questions usually care more about pathways than exhaustive symbol inventories.

Not ideal: vector-db style chunk dumps

Useful as a secondary tool, but not a good primary artifact. It is opaque, hard to review, and easy to distrust.

Why This Hybrid Is Best

For the kinds of questions you described, the agent usually needs two things:

  1. fast orientation
  2. precise next places to inspect

AGENT_SUMMARY.md handles orientation.

AGENT_INDEX.yaml handles precise navigation.

Optional FLOW__*.md files handle repeated high-value workflows.

That combination is better than either markdown alone or structured data alone.

Suggested AGENT_SUMMARY.md Template

# AGENT_SUMMARY

## Repo purpose
- What this repo is for.
- What it is not for.

## Stack
- Language / framework / runtime
- Important libraries
- Operational dependencies

## Top-level structure
- `app_a/`: ...
- `app_b/`: ...
- `config/`: ...

## Entry points
- web requests: `config/urls.py`, ...
- management commands: ...
- background jobs / scripts: ...

## Main domain concepts
- object / item / collection / file-group / upload / DOI / search document / etc.

## Data-flow overview
- inbound request or file
- validation / parsing
- transformation
- storage / indexing
- display / API output

## Cross-repo touchpoints
- consumes from:
- publishes to:
- depends on:

## Where to look for common questions
- metadata mapping:
- ingest logic:
- Solr logic:
- template rendering:
- permissions:
- API serialization:

## Tests
- most relevant test modules
- gaps or weak coverage

## Known traps
- deprecated-looking code that still matters
- misleading filenames
- duplicate code paths

Suggested AGENT_INDEX.yaml Template

repo_name: bdr_workshop_project
repo_role: ingest-and-staging application
stack:
  language: python
  framework: django
  runtime_notes:
    - "Older project structure; inspect settings and app boundaries carefully."

entry_points:
  urls:
    - path: config/urls.py
      note: main URL routing
  scripts:
    - path: manage.py
      note: django management entry point
    - path: process_failed_q.py
      note: ingest-related operational script

major_areas:
  - name: staging
    paths:
      - staging/models.py
      - staging/views.py
      - staging/admin.py
      - staging/ingest_base.py
    responsibilities:
      - upload staging
      - ingest queueing
      - ingest orchestration
  - name: repo_direct_app
    paths:
      - repo_direct_app/views.py
      - repo_direct_app/forms.py
    responsibilities:
      - direct object editing / creation

important_concepts:
  - name: filegroup
    paths:
      - staging/models.py
      - staging/admin.py
  - name: MODS xml
    paths:
      - staging/ingest_base.py
      - repo_direct_app/views.py

cross_repo_touchpoints:
  outbound:
    - repo: bdr_apis_project
      reason: API-side read/search exposure after ingest
    - repo: bdr_studio_project
      reason: eventual display of ingested metadata
    - repo: bdr_indexer
      reason: Solr/index consequences if metadata changes

search_hints:
  metadata_mapping_terms:
    - "mods"
    - "titleInfo"
    - "note"
    - "abstract"
  ingest_terms:
    - "ingest"
    - "queue_ingest"
    - "IngestFileGroup"

high_value_tests:
  - path: staging/test_ingest_base.py
  - path: staging/test_admin.py

known_traps:
  - "Some key behavior lives in admin-driven ingest paths, not only in public views."
  - "A repo may mention MODS generation in multiple places; ingestion path is more important than generators for downstream effects."

Suggested Flow-File Template

# FLOW: Ingest

## Purpose
What workflow this file explains.

## Trigger
- admin action
- uploaded file
- form submit
- cron / script

## Entry points
- `staging/admin.py`
- `staging/views.py`

## Main path
1. request arrives at ...
2. validated by ...
3. transformed by ...
4. queued or persisted by ...
5. downstream effects in other systems ...

## Related repos
- `bdr_apis_project`: ...
- `bdr_studio_project`: ...
- `bdr_indexer`: ...

## Likely change points
- if adding a new metadata field, inspect ...
- if changing access behavior, inspect ...

## Verification
- tests to run
- UI pages to inspect
- Solr/API checks to perform

Example: Why The Hybrid Helps

If later you ask:

"We want to add a mods:note type=\"image_description\" attribute and have it flow from workshop ingest into studio display."

The summary set should let the agent answer in stages:

  1. use bdr_workshop_project/AGENT_SUMMARY.md to identify likely ingest and MODS entry points
  2. use bdr_workshop_project/AGENT_INDEX.yaml to jump directly to ingest, staging, and metadata handling files
  3. use bdr_apis_project/AGENT_SUMMARY.md and AGENT_INDEX.yaml to find API serialization and Solr-related areas
  4. use bdr_studio_project/AGENT_SUMMARY.md and AGENT_INDEX.yaml to find display, query, and template paths
  5. use any FLOW__search_indexing.md or FLOW__display_rendering.md files to avoid re-deriving the cross-repo path from scratch

That is the core win.

Suggested Generation Strategy

I would not start by trying to summarize every repo to the same depth.

Instead:

Tier 1: start with the big cross-repo repos

  • bdr_workshop_project
  • bdr_studio_project
  • bdr_apis_project
  • probably also bdr_indexer
  • maybe bdr_viewers if it still matters to current display architecture

For these, create:

  • AGENT_SUMMARY.md
  • AGENT_INDEX.yaml
  • one focused FLOW__*.md file where appropriate

Tier 2: smaller or library repos

For these, create only:

  • AGENT_SUMMARY.md
  • maybe AGENT_INDEX.yaml if the repo has enough complexity

Examples:

  • bdrcommon
  • bdrxml
  • mods_generator

Tier 3: revisit after real usage

After using the summaries for a few real tasks, adjust the template based on where the agent still has to search too much.

Suggested Prompts

These prompts are meant for future use when generating the per-repo files.

Prompt 1: generate the main summary

Inspect this repository and create `AGENT_SUMMARY.md`.

The audience is:
1. a human maintainer
2. an agent that will later answer architectural questions quickly

Focus on:
- what the repo is for
- major apps/modules
- entry points
- important data flows
- cross-repo touchpoints
- where to look for metadata mapping, ingest, Solr/search, rendering, permissions, and tests
- known traps, misleading areas, or legacy code that still matters

Do not write a generic README-style overview.
Do not try to document every file.
Optimize for future code navigation and change-planning.

Use concrete file paths throughout.
Keep it concise but high signal.

Prompt 2: generate the structured index

Inspect this repository and create `AGENT_INDEX.yaml`.

The file should be a compact navigation map, not an exhaustive symbol dump.

Include:
- repo role
- stack
- entry points
- major areas with file paths and responsibilities
- important concepts / models with file paths
- inbound and outbound dependencies
- cross-repo touchpoints
- search hints
- high-value tests
- known traps

Prefer stable architectural landmarks over low-level function inventories.
Use YAML.
Keep it easy for a human to maintain manually.

Prompt 3: generate a focused flow file

Inspect this repository and create `FLOW__INGEST.md` for the ingest path.

Explain:
- what triggers ingest
- the main entry points
- the sequence of code paths involved
- important transformations
- external calls and downstream effects
- likely change points for new metadata fields
- tests and verification points

Use exact file paths.
Keep it short and path-oriented.
Do not include unrelated repo history or broad general documentation.

Prompt 4: refresh an existing summary after code changes

Review the existing `AGENT_SUMMARY.md`, `AGENT_INDEX.yaml`, and any `FLOW__*.md` files in this repo.

Then inspect the current code and update the summary artifacts to match reality.

Prioritize:
- changed entry points
- changed module responsibilities
- changed data flows
- new tests
- new cross-repo touchpoints
- removal of stale guidance

Do not rewrite everything from scratch if the existing files are still mostly correct.

Bottom Line

If choosing one format only, choose markdown.

If choosing the best format set for real cross-repo agent work, choose:

  • AGENT_SUMMARY.md
  • AGENT_INDEX.yaml
  • optional FLOW__*.md for the few workflows that matter repeatedly

That is the best balance of:

  • human usefulness
  • agent usefulness
  • maintainability
  • cross-repo architectural value
  • resistance to becoming stale

Birkin-Prompt

(This is the prompt that created the information above.)

Goal: determine the best kind of "repo-summary" file(s) to create.

Context:

  • There are a lot of repo-projects in all_the_repos -- the encompassing directory of most of our repository-ecosystem code.

  • One of the main reasons for the existence of all_the_repos is to be able to ask you architectural questions that span project-repos. Some kinds of examples: - We want to add a mods:note type="image_description" attribute and flow it into the ingestion process (all_the_repos/bdr_workshop_project) -- and have it display properly via "alt-text" in the front-end display (all_the_repos/bdr_studio_project). The questions: What issues do we need to consider? What files need to be change? Make a comprehensive plan for this. - Write up a report on the interplay of OCFL-data-updates and solr-updates in preparation for a possible-drift analysis / cron-checking-job. - Don't answer those two example questions -- they're for you to understand my cross-project-repo interest.

  • Because some of these repos are very big -- I would like you to create (not now; at some point in the future) an "agent-summary-doc" for each repo -- so that you don't have to exhaustively inspect all the code in every repo any time you're asked about it.

  • This is somewhat akin to "skills" -- where part of those often involve creating a summary and index so that you easily can have both an overview of the project -- and easily can know where to efficiently look for more detailed info if needed.

  • I'm aware that for me, a human, a "markdown" style summary doc might be the most useful kind of document.

  • But for you, I don't know what might be most useful. For all I know, a json file of function/method mappings with example inputs and outputs would be best.

Task:

  • Think about the file or files that would be most useful for you to be able to efficiently understand a big project-repo -- as also be able to point you to where you might best be able to find more detailed specific info.

  • Write up a document with your thoughts, and suggested prompt(s), and save it to all_the_repos/SUMMARY_DOC_POSSIBILITIES.md

  • I think all_the_repos/bdr_apis_project or all_the_repos/bdr_studio_project or all_the_repos/bdr_workshop_project may be some of the biggest projects, so consider using them as example project-repos if that's useful to you.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment