> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Documents and files

> Attach source material and review generated PDFs, spreadsheets, presentations, and documents in local sessions.

export const ScreenshotCrop = ({src, alt, width, height, x = 0, y = 0, cropWidth = width, cropHeight = height, maxWidth = "100%"}) => <div className="not-prose" style={{
  position: "relative",
  overflow: "hidden",
  width: "100%",
  maxWidth,
  margin: "0 auto",
  aspectRatio: `${cropWidth} / ${cropHeight}`
}}>
    <img src={src} alt={alt} width={width} height={height} style={{
  position: "absolute",
  display: "block",
  margin: 0,
  maxWidth: "none",
  width: `${width / cropWidth * 100}%`,
  height: "auto",
  left: `${-x / cropWidth * 100}%`,
  top: `${-y / cropHeight * 100}%`
}} />
  </div>;

A coding task can include more than source code: a requirements document, a screenshot of a defect, a CSV to inspect, or a report generated from the project. Use attachments to supply inputs and the document preview to inspect supported outputs beside the conversation.

## Add source material

In a local Code session, use the composer's **+** menu to add files, or paste or drop attachments into the composer. Name the part that matters and the result you need. For example:

> Read the attached requirements and compare the checkout quantity rules with checkout.js. List mismatches with references to the requirement and the relevant code. Do not edit files yet.

Some document operations need a matching skill. If the app reports an inactive skill, enable it under **Settings → Extensions → Skills** before retrying. Images need a model that accepts image input. For repository files already in the project, select the file from `@` suggestions rather than attaching another copy.

<Frame caption="Attach source material and describe the comparison you want before sending the request.">
  <ScreenshotCrop src="/images/mka1-code/guides/documents.jpg" alt="Requirements attachment beside a request to compare code and tests" width={2720} height={1660} x={1000} y={1230} cropWidth={1160} cropHeight={410} maxWidth="100%" />
</Frame>

## Request an output you can review

Specify the format, source data, and intended use of the document. A useful request might be: “Create a PDF summary of this checkout fix with the original bug, changed files, test command, and actual results. Save it in this project's reports folder.” Check that any claimed results come from the session's tool output.

The available creation and editing tools depend on enabled skills and the environment. If a required tool is unavailable, resolve that requirement before expecting the document to be generated. The preview can display supported files; it does not by itself supply all tools needed to create them.

## Preview documents

**Preview document** opens a document from the agent's response alongside the conversation. It supports PDF, DOCX, XLSX, PPTX, CSV, and TSV files in the local session's project folder, with page, sheet, or slide navigation as appropriate. The preview is read-only and refreshes as the file changes. Spreadsheet previews display saved values without recalculating formulas, so the displayed numbers depend on what was saved in the file.

Document previews are unavailable in remote and cloud sessions. Legacy `.doc`, `.xls`, and `.ppt` files, password-protected documents, and Office files with macros are unsupported.

### Inspect and revise a document

1. Open **Preview document** from the file link in the response.
2. Use **Expand preview** for more room, then navigate through the pages, sheets, or slides.
3. Describe the location and requested correction in the conversation. For example: “In the PDF, the table on page 2 clips its final column. Adjust it to fit and regenerate the file.”
4. After the edit, inspect the updated preview. Use **Refresh preview** if needed.

The preview itself does not edit the document. For a spreadsheet, ask the agent to recalculate and save the workbook before relying on displayed formula values. If a preview fails, choose **Try again** and check that the file still exists inside the session's project folder. Open unsupported formats in the application that created them.

Continue with [Connectors, skills, and plugins](/docs/mka1-code/extensions).
