---
name: commercial-offer
description: Use when the user wants to generate the F2 commercial offer from the Discovery project document. Reads docs/discovery/<project-slug>/project-doc/project.md plus related Discovery artifacts, then writes docs/discovery/<project-slug>/commercial-offer/commercial-offer.md. Triggers on "/machine-discovery:commercial-offer <project-slug>", "/commercial-offer <project-slug>", and requests for the F2 commercial offer.
---

# Commercial Offer

Generate the F2 Commercial Offer from the F1 Discovery project document.

## Inputs

```text
docs/discovery/<project-slug>/project-doc/project.md
docs/discovery/<project-slug>/requirements/index.json
docs/discovery/<project-slug>/planning/phase-plan.md
docs/discovery/<project-slug>/draft-prds/index.json
```

## Output

```text
docs/discovery/<project-slug>/commercial-offer/commercial-offer.md
```

## Operating protocol

1. Parse `$ARGUMENTS` and resolve the output language.
   - The first token MUST be a kebab-case ASCII project slug.
   - A second token MAY be `es` or `en`; if present, it wins.
   - If a second token is present and is not `es` or `en`, stop with `NEEDS INPUT: language must be es or en`.
   - If no language argument is present, inherit `language` from `project-doc/project.md`; if missing, use the current user request language; if ambiguous, default to `es`.
   - If missing or invalid, stop with `NEEDS INPUT: indica el project slug, por ejemplo /machine-discovery:commercial-offer acme-demo`.
2. Validate prerequisites:
   - `project-doc/project.md` MUST exist and be non-empty.
   - `requirements/index.json` MUST exist and include at least one RF.
   - `planning/phase-plan.md` MUST exist and be non-empty.
   - `draft-prds/index.json` MUST exist and be valid JSON.
3. Ensure `docs/discovery/<project-slug>/commercial-offer/` exists.
4. If `commercial-offer/commercial-offer.md` already exists, ask before overwriting. Do not silently replace it.
5. Write `docs/discovery/<project-slug>/commercial-offer/commercial-offer.blocks`.
   - The content file MUST contain one `@@KEY@@` block for each placeholder in `templates/commercial-offer.<lang>.md.tmpl`, including `@@LANG@@`.
   - Fill it from the validated artifacts.
6. The offer MUST preserve the project structure needed by the client: scope, milestones, deliverables, assumptions, exclusions, and commercial terms.
7. The offer MUST exclude internal team breakdown details by default. It MAY include client-facing delivery roles only when the source artifacts require them.
8. Unknown price, payment terms, billing milestones, penalties, taxes, currency, legal clauses, or sales approvals MUST be written as `NEEDS INPUT: <specific question>`.
9. Run `bash plugins/machine-discovery/scripts/assemble-doc.sh plugins/machine-discovery/skills/commercial-offer/templates/commercial-offer.<lang>.md.tmpl docs/discovery/<project-slug>/commercial-offer/commercial-offer.blocks docs/discovery/<project-slug>/commercial-offer/commercial-offer.md`.
10. Delete `commercial-offer.blocks` only after validating the assembled Markdown.
11. Score against [references/checklist.md](references/checklist.md). Pass criterion: 8/8.
12. Stop after reporting the output path and print exactly `/machine-discovery:render-docx docs/discovery/<project-slug>/commercial-offer/commercial-offer.md` as the next-step suggestion. Do not generate SOW.

## Hard rules

- **Project document required.** Do not generate a commercial offer before `project-doc/project.md` exists.
- **No SOW.** This plugin iteration MUST NOT generate a Statement of Work.
- **No legal or pricing invention.** Do not invent commercial, legal, tax, payment, penalty, or acceptance terms absent from source artifacts.
- **Internal team privacy.** Do not include internal team sizing or resource availability details unless explicitly requested by the user.
- **Traceability required.** Deliverables and milestones MUST cite RF, PRD, or phase references where applicable.
- **Script-owned Markdown.** Final Commercial Offer Markdown MUST be assembled by `scripts/assemble-doc.sh` from `.blocks` and template.
- **Selected-language output.** Generated titles, body prose, and template-owned headings MUST match the resolved output language; verbatim source quotes stay unchanged.
- **No auto-chaining.** Commercial Offer is the last F1 artifact in this plugin iteration.
- **Namespaced next step.** Final user-facing next-step suggestion MUST be `/machine-discovery:render-docx docs/discovery/<project-slug>/commercial-offer/commercial-offer.md`.

## References

- Commercial offer templates: [templates/commercial-offer.es.md.tmpl](templates/commercial-offer.es.md.tmpl), [templates/commercial-offer.en.md.tmpl](templates/commercial-offer.en.md.tmpl)
- Quality checklist: [references/checklist.md](references/checklist.md)
