Skip to content
Back to skills

Issuance Import

ASecurity

Internal file-ingest sub-skill for carta-issuance. Turns an uploaded spreadsheet (.xlsx/.xlsm/.csv/.tsv) or document (.pdf/.docx) into the prefilled rows the carta-issuance run consumes: a spreadsheet for certificates, option grants and profits interest units, a document for any of the nine types. Not invocable directly — dispatched by carta-issuance Phase 0.25.

  • 16 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
ai-agentsbashapisecuritydocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 28, 2026

npx -y skills add carta/plugins --skill issuance-import --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Issuance Import?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Issuance Import
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/carta-issuance-import/badge)](https://www.skillsdirectory.com/skills/carta-issuance-import)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: carta-cap-table:issuance-import
description: >-
  Internal file-ingest sub-skill for carta-issuance. Turns an uploaded
  spreadsheet (.xlsx/.xlsm/.csv/.tsv) or document (.pdf/.docx) into the
  prefilled rows the carta-issuance run consumes: a spreadsheet for
  certificates, option grants and profits interest units, a document
  for any of the nine types. Not invocable directly —
  dispatched by carta-issuance Phase 0.25.
owner: carta-cap-table maintainers
allowed-tools: []
---

<!-- carta:plugin-version -->
<carta-plugin>carta-cap-table:6.124.1</carta-plugin>

# issuance-import

Reads a file the admin already has — typically the Carta importer template they
downloaded from the app — and hands `carta-issuance` a prefilled set of rows. The
file feeds the **front** of the existing pipeline; it does not
add a path around any gate. Phase 1 still resolves stakeholders, and the run still
saves, checks, reviews and issues as [companion-surface.md](../references/companion-surface.md) says.

**Do not invoke this skill directly.** Dispatched by `carta-issuance`
[Phase 0.25](../references/engine.md#phase-025--ingest-an-uploaded-file).

## References

| File | Purpose |
|---|---|
| `scripts/parse_upload.py` | **Does the parsing.** Header detection, column mapping, value coercion, `security_type` detection, and local name→id resolution. The model never hand-parses a workbook — a hand-read column is exactly how a quantity lands in an exercise-price field. |
| `references/column-map.md` | The header synonyms and value picklists as documentation, for humans and for other skills to reuse rather than fork. |

## Two rules the script exists to enforce

1. **Unresolved is blank, never guessed.** A `Vesting Schedule` or `Share Class`
   cell that doesn't match a real record exactly (case- and
   punctuation-insensitively) leaves the field **unset** and records an
   `import_notes` entry. There is deliberately no fuzzy matching: an
   almost-match issues genuinely wrong terms, and unlike a bad quantity the
   server cannot catch it. Do not add fuzzy fallback later without a
   product decision.
2. **Nothing is dropped silently.** Unmapped columns, skipped rows, and
   uncoercible cells all land in `_import_report.json`, and per-field in each
   row's `import_notes`. A dropped `Exercise Price` column is a wrong-priced
   grant the user has no way to notice.

## Usage

```bash
uv run "${CLAUDE_PLUGIN_ROOT}/skills/carta-issuance/issuance-import/scripts/parse_upload.py" --file "<path>" [--sheet "<sheet name>"] [--reference "<scratchpad>/_reference.json"] --out-dir "<scratchpad>"
```

- `--sheet` — only needed when the workbook has more than one importable sheet
  (the script exits 2 with `CANDIDATES=[…]`; ask which, then re-run).
- `--reference` — the `issuance_init` payload written to a file: its raw section
  envelopes plus `stakeholders`. Pass it to get ids resolved in the same
  run. Omit it and every name comes back as an `import_notes` entry with the
  field left blank, which is correct but makes the admin re-pick by hand — so
  pass it whenever Phase 0.5's fetches have landed.

### Output

| File | Contents |
|---|---|
| `_import_knowns.json` | `{security_type, rows, equity_plan_id?, batch_errors?}` — its `rows` are the batch |
| `_import_report.json` | `{mode, source_file, sheet, row_count, unmapped_columns, skipped_rows, plan_name, batch_errors, notes_by_row}` |
| `_import_text.txt` | Document mode only — extracted text |

stdout is `KEY=value` lines (`IMPORT_KNOWNS`, `IMPORT_REPORT`, `ROW_COUNT`,
`SECURITY_TYPE`). Exit 0 parsed, exit 2 nothing usable — the stderr line says
which (`ERROR:` or `AMBIGUOUS:` plus `CANDIDATES=`).

## Running the phase — step by step

`carta-issuance` [Phase 0.25](../references/engine.md#phase-025--ingest-an-uploaded-file) hands you the
whole ingest and hands back the rows the run starts from. These are its steps; nothing here is repeated in
`SKILL.md`, so work through them in order and return to [Phase
0.5](../references/engine.md#phase-05--configure-the-issuance) at the end.

### Step 0 — Confirm you can actually run the parser

The parser is a local script, so this phase needs `Bash`. **Check your own tool
surface for Bash before promising an import** — no host guarantees it.

No Bash → **do not hand-read the file.** Reading a workbook by eye is the failure this whole
phase exists to prevent, and offering it as a fallback would make the parser's guarantees
optional. Say so and route to the feature built for this:

> *"I can't read spreadsheets in this session. Two options: import it directly in Carta's Drafts
> UI, which takes this same template — or paste the rows here as text and I'll set them up."*

Pasted-as-text rows are fine: they arrive in the prompt, so the ordinary prompt-driven flow
handles them with the user's own values in plain sight. That is different in kind from silently
parsing a binary nobody can see.

### Step 1 — Locate the file

Take the path straight from the prompt; a pasted `~/Downloads/…` path is the norm. Only if the
user said "the attached file" with no path, list the likely directories (`ls -t ~/Downloads`,
`~/Desktop`, the cwd) and look for a supported extension recently modified. Zero or several
plausible matches → `AskUserQuestion` which one (allowed by engine rule 5's file carve-out).
`Bash(find *)` is deliberately not granted to this skill — use `ls`.

### Step 2 — Parse, before spending any round trip

```bash
uv run "${CLAUDE_PLUGIN_ROOT}/skills/carta-issuance/issuance-import/scripts/parse_upload.py" --file "<path>" --out-dir "<scratchpad>"
```

This first run is deliberately **without** `--reference`: it costs nothing, and its output tells
you the two things Phase 0.5's fetches need — the `security_type` and the names in the file. It
prints `SECURITY_TYPE=`, `ROW_COUNT=`, and the paths it wrote.

- **Exit 2 with `AMBIGUOUS:` + `CANDIDATES=[…]`** — the workbook has more than one importable
  sheet. `AskUserQuestion` which, then re-run with `--sheet "<name>"`. **Never merge two
  sheets into one batch** (carta-issuance hard rule 1) and never pick for the user.
- **Exit 2 with `ERROR:`** — nothing usable. Surface the message verbatim and fall back to the
  ordinary prompt-driven flow; do not guess at rows.

**Reconcile `security_type` with the prompt.** File and prompt disagreeing is a real fork →
`AskUserQuestion`. The file wins only when the prompt never said.

### Step 3 — Resolve the names to ids

Run [Phase
0.5](../references/engine.md#phase-05--configure-the-issuance)'s `issuance_init` call exactly as
documented, with `security_type` now supplied by the file, and pass `stakeholder_names`
covering **the names the file contains** rather than the names the prompt named — that keeps
the lookup bounded by the file's row count instead of roster size. Pass the whole list at once;
a 40-row sheet resolved through a concatenated `search=` matches **nobody** and would create 40
duplicate stakeholders on a real cap table.

**The [account-setup gate](../references/engine.md#account-setup-gate-option-grant-and-piu) still applies.** Having a
parsed file in hand is not a reason to push past it: a corp with no option-grant document set
cannot issue one, whether the rows came from a spreadsheet or from the prompt. Stop where the
gate says to stop — the parsed rows cost nothing and the file is still there afterwards.

### Step 4 — Re-run the parser with that payload

```bash
uv run "${CLAUDE_PLUGIN_ROOT}/skills/carta-issuance/issuance-import/scripts/parse_upload.py" --file "<path>" [--sheet "<name>"] --reference "<scratchpad>/_reference.json" --out-dir "<scratchpad>"
```

`--reference` is the `issuance_init` payload you just wrote to a file. The
parser matches the file's free text against it — vesting schedule, acceleration terms, share
class (by name **or** prefix), legend (by code or name), document set, equity plan, and the
roster — and writes `_import_knowns.json`. A cell matching nothing leaves its field **unset**
with an `import_notes` entry; there is no fuzzy matching, and do not add any by hand.

### Step 5 — Hand the rows back

`_import_knowns.json` holds `{security_type, rows, equity_plan_id?, batch_errors?}`. Its `rows`
**are** the batch — return them and continue. The row count
comes from the file, so engine rule 5's quantity-vs-headcount heuristic doesn't apply here (a
40-row sheet is unambiguously 40 rows). Surface `batch_errors` alongside the rows, and
hold `equity_plan_id` for the first mutate only.

Each row may carry `import_notes` — `[{field, raw_value, reason}]`, **display-only**. The run
must both **report every note against the field it names** and **leave that field unanswered**,
so nothing can be submitted until the admin settles it. A marker alone is ignorable; the
withheld default is what actually prevents a silent wrong issuance.

**Strip `import_notes` before any mutate** — same discipline as the review-only fields
([Build the mutate payload](../references/engine.md#build-the-mutate-payload-from-your-phase-1-resolved-rows)).
The server rejects unknown keys.

### Step 6 — Say what happened, in one line, before the first save

Read `_import_report.json` and report totals — never silently drop a column or a row. A dropped
`Exercise Price` column is a wrong-priced grant the user has no way to notice.

> *"Read 38 rows from Q3-grants.xlsx. State of Residency and Employee ID aren't fields this
> flow sets, and I couldn't match 3 values — I'll ask for those. Everything else is filled in."*

**Name the skipped rows and the unmapped columns, not just their counts.** Rows the import
doesn't read (RSUs, SARs, CBUs, warrants, RSAs, convertibles) are skipped with the parser's
`reason` — an admin who thinks a 40-row sheet issued 40 securities when it issued 37 has been
misled. `unmapped_columns` holds the headers this skill has no field for;
several — `state_exemption`, `state_of_residency`, `employee_id`, `cost_center`, `job_title`,
`salary`, `convertible_note` — are dropped by design, and *"2 columns I couldn't map"* leaves an
admin who deliberately filled one in believing it landed. Say which: *"State of Residency and Employee ID aren't fields this flow
sets — add them on the stakeholder record in Carta."*

### Documents (`.pdf` / `.docx`)

Build the rows yourself per [Document mode](#document-mode-pdf--docx) below, then continue
from Step 3. A document for any of the other six types follows the order Document mode gives
it instead.

---

## Spreadsheet mode

Deterministic end to end.

- **Header row** — scanned across the first 6 rows, taking whichever maps the
  most known columns. Carta's importer template puts a paragraph of instructions
  in row 1 and the real headers in row 2, so assuming row 1 reads prose as
  column names. Needs ≥3 recognizable headers to count as a header row at all.
- **`security_type`** — decided by header signature first (`Exercise Price` /
  `Equity Plan Name` / `Document Set` → `option_grant`; `Share Class` /
  `Legend` / `Rule 144 Date` → `certificate`), sheet name only as a tiebreak.
  A **threshold** column decides `piu` outright, before that comparison: the PIU
  template also carries an equity plan and a document set, which would otherwise
  tie it with the grant signals.
  Generic headers (`Quantity`, `Email`) are deliberately not signals.
- **Multiple importable sheets** → `AmbiguousInput`, never a guess and never a
  merge. A batch is one security type (carta-issuance hard rule 1).
- **Values** — dates to `YYYY-MM-DD`; numbers stripped of thousands separators,
  currency symbols and parenthesised negatives; `Individual` / `Non Individual`
  to `INDIVIDUAL` / `ORGANIZATION` (matches `lib/issuance_fields.py`'s
  `STAKEHOLDER_KIND_CHOICES`; never `NON-INDIVIDUAL`, which the draft save stores
  as `INDIVIDUAL`);
  relationship, option type and grant reason matched exactly against
  [payload-reference.md § Picklists](../references/payload-reference.md#picklists).
- **Out-of-scope rows skipped, not coerced.** An importer sheet can carry RSUs,
  SARs, CBUs, warrants, RSAs, convertibles: rows the import doesn't read. Those rows
  are skipped with the parser's `reason`. Never reshape them into a grant of a
  different type.
- **Multiple equity plans in one sheet** → a `batch_errors` entry. A draft set
  is locked to one plan server-side, so this has to surface before the first save
  rather than failing at it.

## Document mode (`.pdf` / `.docx`)

The script extracts text and **stops**. It does not build rows from prose.

A signed grant doc or board consent has no fixed layout, so turning it into rows
is a judgement call — doing it in the script would mean guessing silently, which
is rule 2 inverted. So: read `_import_text.txt`, write the rows yourself **in
this script's own row schema**, and mark every field you filled this way with an
`import_notes` entry carrying `"confidence": "low"`. The run treats those as
needs-confirmation, so a misread date is something the admin sees rather than
something that issues.

If the text comes back empty the file is a scan — the script exits 2 saying so.
Route the admin to OCR it or give the values directly; never infer values
from a filename.

**A document for an RSA, RSU, SAR, CBU, warrant or convertible note** builds no rows in this
schema: `ROW_KEYS` holds only certificate, option grant and PIU fields. Never reshape them into
an option grant. In this order:

1. Read `_import_text.txt` and name the `security_type` from the document, as carta-issuance's
   *Resolve `security_type`* table does; reconcile it with the prompt as Step 2 says.
2. Run Step 3 with that type and the names the document contains. Its `field_spec` is what the
   rows are built from, and the type's account gate in
   [other-types.md](../references/other-types.md#per-type-values) applies: stop where it stops.
3. Build the rows as
   [companion-surface.md § 5](../references/companion-surface.md#5-build-the-draft-set) builds a
   typed request's. Every value read from the document's prose is a `needs_input` cell, its
   source's `note` holding the document's exact words for it, so § 6 asks the admin to confirm
   it: the same guard the `"confidence": "low"` note gives the three types above.
4. Skip Step 4: the parser resolves nothing for these types. Then Step 6.

**Take only what the document states.** A grant agreement rarely names a vesting template by
the company's own template name, so leave `vesting_template_id` unset rather than inferring it
from prose like "vests monthly over four years" — that is the fuzzy match rule 1 forbids, done
by hand.

## Row schema

`ROW_KEYS` in `parse_upload.py` is the authoritative list. A stray key would survive into the
`save_drafts` payload and be rejected server-side, so nothing outside it belongs on a row.

Two additions beyond that list:

| Key | Meaning |
|---|---|
| `row_key` | Positional `r0`, `r1`, … — the key the run re-matches a row to its `draft_pk` by |
| `import_notes` | `[{field, raw_value, reason}]` — display-only. **Never** send to any mutate; `scripts/serialize_drafts.py` strips it at the payload boundary |

Dates in a row are **always ISO** (`YYYY-MM-DD`) — that is what `<input type="date">` accepts
and reads back. Three of them (`grant_expiration_date`, `vesting_start_date`, `rule_144_date`)
are `CharField`s the API only takes as `MM/DD/YYYY`; `serialize_drafts.py` converts them on the
way out. Do not emit `MM/DD/YYYY` here — a date input reads back ISO and nothing else.

Files in this skill

  • SKILL.md8.1 KB
  • references/column-map.md11.5 KB
  • scripts/parse_upload.py45.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.