Build context

From Alexander-M-Dickerson/ai-asset-pricing · View interactive version

Build context is an AI agent skill from the GitHub repository Alexander-M-Dickerson/ai-asset-pricing. Generate guidance/paper-context.md from user-provided .tex, .md, or .pdf files

How to use this skill

Skill file

Build Context Skill

Generate a structured guidance/paper-context.md file that captures everything Claude needs to know about a paper before writing, editing, or auditing it. This file is consumed by /audit-section, /check-consistency, /edit-section, /full-paper-audit, /audit-captions, and other writing skills.

Examples

Input

One or more file paths. Supported formats:

If no arguments are provided, scan the current project directory for main.tex or *.pdf files and prompt the user to select.

Workflow

Step 1: Read Source Files

  1. Read each provided file
  2. For .tex: extract the full document
  3. For .pdf: read the PDF (use pages parameter for large files; start with first 10 pages, then continue if needed)
  4. For .md: read as-is (these are usually the author's own notes)

Step 2: Extract Paper Identity

From the source material, identify:

Step 3: Extract Key Results

Identify the paper's main quantitative and qualitative findings:

For each result, record:

Step 4: Extract Terminology

Build a terminology table:

Format as:

| Preferred | Avoid | Notes |
|-----------|-------|-------|
| [correct term] | [incorrect/informal term] | [context] |

Step 5: Extract Structure

If working from .tex, record:

Step 6: Extract Sample Description

Step 7: Extract Citation Context

Identify the paper's most important citations:

Step 8: Write paper-context.md

Write the file to guidance/paper-context.md (creating the guidance/ directory if needed). Use this template:

# Paper Context

Generated by `/build-context` on [date]. Source files: [list].

## Identity

- **Title**: [title]
- **Authors**: [authors]
- **Core contribution**: [1-3 sentences]

## Abstract

[abstract text]

## Key Results

### Primary
1. [Result]: [magnitude] ([table/figure reference])
2. ...

### Secondary
1. ...

### Null Results
1. ...

## Terminology

| Preferred | Avoid | Notes |
|-----------|-------|-------|
| ... | ... | ... |

## Abbreviations

| Abbreviation | Definition |
|-------------|------------|
| ... | ... |

## Sample

- **Period**: [start] to [end]
- **Observations**: [count] ([unit])
- **Sources**: [data sources]
- **Key filters**: [any important sample restrictions]

## Section Structure

| Key | Section Title | Summary |
|-----|--------------|---------|
| `introduction` | Introduction | ... |
| ... | ... | ... |

## Key Labels

- Tables: [list of table labels]
- Figures: [list of figure labels]
- Equations: [list of key equation labels]

## Important Citations

- [Author (Year)]: [why it matters to this paper]
- ...

Step 9: Confirm with User

After writing, print:

  1. The file path written
  2. A summary of what was extracted
  3. Any gaps marked [HUMAN EDIT REQUIRED] where information could not be determined from the source files

Ask the user to review and fill in any gaps.

Integration

This file is consumed by:

Re-running

If the paper evolves, re-run /build-context to regenerate. The skill will overwrite the existing guidance/paper-context.md. The user should review the diff to ensure nothing important was lost.

Edge Cases

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.