---
name: process-input
description: Use when the user wants to process raw audio + text inputs for one machine-business project. Transcribes audio verbatim via the free-whisper MCP, writes one Markdown resource record per input under docs/inputs/<project-slug>/transcriptions/, and updates docs/inputs/<project-slug>/index.json so already-ready resources are not processed again. Triggers on requests to process or transcribe project inputs, "process-input", "/machine-business:process-input <project-slug> [files]", and "/process-input <project-slug> [files]".
---

# Process Input

Turn a mix of raw audio and text inputs into **individual Markdown resource records** for one project. This is the shared intake step that feeds `business-proposal` and later workflows.

## Core principle

Each resource record is a faithful record of one source. Audio transcripts MUST be the exact free-whisper output. Text inputs MUST be copied without interpretation. The skill does not summarize, rephrase, judge, translate, or invent.

`docs/inputs/<project-slug>/index.json` is the project input registry. It stores only source paths, statuses, and references to resource records. It MUST NOT store full transcript text.

## Canonical layout

```text
docs/inputs/<project-slug>/
  raw/
  transcriptions/
    <resource-slug>.md
  index.json
```

## When to use

- The user invokes `/machine-business:process-input <project-slug>` with no files -> process `docs/inputs/<project-slug>/raw/*`.
- The user invokes `/machine-business:process-input <project-slug> <files...>` -> process the explicit audio/text paths or inline text.
- The user adds more project inputs later -> run the same command; sources already marked `ready` are reused.

Skip for: proposal writing (use `business-proposal`), DOCX rendering (use `render-docx`), or editing an already-created resource record.

## Prerequisites

The free-whisper MCP server MUST be reachable for audio transcription. The API URL is baked into `.mcp.json`; the per-user `FREE_WHISPER_API_TOKEN` is supplied via `/machine-business:setup-token` (saved to the global `~/.claude/settings.json`) and activated by reconnecting the MCP. See [../../README.md](../../README.md) for setup.

If the token is missing/invalid (HTTP 401) or the server is unreachable, mark each affected audio as failed and present these 4 unblock steps **in the user's current interaction language** (translate the wording; do not hardcode a language). Keep the URL and slash commands literal. **Step 1, the token URL, is MANDATORY** — never omit it or change `https://transcribe.skillbase.yareytech.com`:

1. Get your token at https://transcribe.skillbase.yareytech.com
2. Save it: `/machine-business:setup-token`
3. Reconnect the MCP: run `/mcp`, select **free-whisper**, reconnect it
4. Retry: `/machine-business:process-input <project-slug>`

It MUST NOT fabricate transcripts.

## The 3 phases

| # | Phase | Input | Output | Prompt file |
|---|---|---|---|---|
| 1 | Classify & index check | `$ARGUMENTS` = `<project-slug> [files...]` | Ordered manifest with ready/reprocess decisions | [prompts/01-classify-inputs.md](prompts/01-classify-inputs.md) |
| 2 | Transcribe | Manifest audio items that are not already ready | Verbatim transcript per new audio, or explicit failure | [prompts/02-transcribe.md](prompts/02-transcribe.md) |
| 3 | Write records & index | Manifest + transcripts/text | Resource `.md` files + updated `index.json` | [prompts/03-consolidate.md](prompts/03-consolidate.md) |

## Operating protocol

1. Read the matching prompt file in `prompts/` and run it. Treat the prompt body as a system instruction and follow its rules literally.
2. Run phases in order. Do not ask for approval between classification, transcription, and record writing unless the active prompt says to stop.
3. Stop conditions:
   - Missing or invalid project slug.
   - A path does not exist, is unreadable, or is empty.
   - A glob matches zero files, or a path has an unknown extension.
   - `docs/inputs/<project-slug>/index.json` exists but is invalid JSON or has a different `project`.
   - At least one new audio is `TRANSCRIPTION_FAILED`; ask whether to proceed with successful resources, retry after setup is fixed, or cancel.
4. Phase 3 copies [templates/input-record.md.tmpl](templates/input-record.md.tmpl) once per new resource and writes to `docs/inputs/<project-slug>/transcriptions/<resource-slug>.md`.
5. After writing, score against [references/checklist.md](references/checklist.md). Pass criterion: 9/9 items.

## Index contract

`docs/inputs/<project-slug>/index.json`:

```json
{
  "project": "<project-slug>",
  "inputs": []
}
```

Each `inputs[]` entry contains:

- `src`: project-relative source path such as `raw/memo.m4a`, or `inline:<N>`.
- `md`: project-relative resource record path such as `transcriptions/memo.md`, or `null` when not ready.
- `status`: `ready`, `failed`, or `ignored`.

## Hard rules

- **Project slug required.** The first argument MUST be a kebab-case project slug.
- **Source identity.** Resources are identified by `src`, not by file content.
- **No reprocessing ready resources.** If an `inputs[]` entry has matching `src`, `status: ready`, and a readable `md`, reuse it and do not call free-whisper or rewrite the record.
- **Verbatim only.** Transcripts MUST be exact MCP output. Text and inline inputs MUST remain unchanged.
- **No fabrication on failure.** Failed audio stays `failed` in the index with `md: null`. Never invent a transcript.
- **No consolidated record.** This skill writes one `.md` per resource, not one `.md` per batch.
- **Interaction-language wrapper.** Generated headings, notes, and final reports use the current user interaction language. Verbatim source content remains exactly as provided.
- **No auto-chaining.** Producing resource records and updating the index is the end. Suggest the next command, but do not start `business-proposal` or `render-docx`.
- **Namespaced suggestions.** User-facing next-step suggestions MUST use `/machine-business:business-proposal <project-slug>`.

## What NOT to do

See [references/anti-patterns.md](references/anti-patterns.md). Top three:

- **Fabricated transcript** — writing what the audio "probably said" when the MCP call failed.
- **Paraphrased transcript** — tidying or shortening the transcript instead of recording it verbatim.
- **Global folder fallback** — writing to `docs/inputs/transcriptions/` or reading `docs/inputs/raw/` without a project slug.

## References

- Output template: [templates/input-record.md.tmpl](templates/input-record.md.tmpl)
- Phase prompts: [prompts/01-classify-inputs.md](prompts/01-classify-inputs.md), [prompts/02-transcribe.md](prompts/02-transcribe.md), [prompts/03-consolidate.md](prompts/03-consolidate.md)
- Quality checklist: [references/checklist.md](references/checklist.md)
- Anti-patterns: [references/anti-patterns.md](references/anti-patterns.md)
- MCP setup: [../../README.md](../../README.md)
- Source framework: [../../../../docs/framework.md](../../../../docs/framework.md)
