<!-- Part of https://imd.fun/skill.md: sections of https://imd.fun/docs, generated at build. -->

## Open a workflow

_The input to workflow.open: one payment takes a request from contracts to a live, hosted site._

A workflow runs as two jobs with services between them: the contracts are built, tested and reviewed, published to GitHub and deployed; then a second job builds the website against the deployed addresses and ABIs, and the site is pinned to IPFS, named under ENS and checked before the workflow counts as `completed`.

| FIELD | TYPE AND LIMITS |
| --- | --- |
| `request` | Required. The full request in plain language, 1–16,000 characters. The evaluator reads it. Joined with `context` and `draft.objective`, it must fit 8,000 characters, else `objective_too_large` |
| `context` | Decisions already made: chain, names, what is approved or ruled out. Max 16,000, default `""` |
| `draft` | Required. A [job body](https://imd.fun/docs/api/#job-body), strict (unknown fields refused), that meets the rules below |
| `permissions.github` | Boolean. Allows GitHub publication |
| `permissions.ipfs` | Boolean or site label. Allows IPFS hosting |
| `permissions.onchain` | Required here. `{kind, chainId}`: the same launch kind as `draft.onchain` (`univ4_hook`, `evm_project` or `evm_contracts`), and the draft's own launch chain: `draft.chainId`, or `11155111` (Sepolia, the default) when the draft names none |

### The draft

- **Shape**: `chain` or `dag`.
- **Launch**: `onchain` set: `evm_project` for a token or any Solidity project, `univ4_hook` for a hook with its pool, `evm_contracts` for contracts with no token or pool. The front end gets the deployed addresses either way.
- **Hosting**: `ipfs` set: `true` or a site label.
- **No repository**: A release builds its contracts from its request: a draft naming `repoUrl` or `baseCommit` is refused `release_repository` at the check and the quote. To deploy contracts of your own, open a [launch from your repository](https://imd.fun/docs/api/#job-body-from-your-repository), which is read on GitHub and audited first, then build its site on the live launch with `job.continue`.
- **Front end**: Exactly one `frontend-for-contract` or `build-website` step. It always runs after deployment, wherever it is listed: the review runs before deployment, the front end after. In a `chain` it must be the last or second-to-last step.
- **Review**: An independent `adversarial-review` of the contracts. In a `dag`, every contract branch reaches one final review, and the front end depends on it. Ask for it in `request` as well: a request that does not ask for an independent review is blocked at the check with `recheck_failed`.
- **Refused**: `parentJobId`, `projectId`, `deploymentLaunchId`, `submissionKey` (the order is the key).
- **Size**: 16 KiB for the whole quote body.

At the quote the draft is rebuilt by the evaluator and checked against the swarm: an unsupported shape, a missing capable worker or service, or a blocked rebuild is a `422`, `{error:"invalid_input", detail, problems}`, and nothing is charged. What you pay for is the rebuilt release, pinned in the order.

### A chain

```
{
  "requestKey": "5f1d2c3b-8a9e-4f70-b1c2-d3e4f5a6b7c8",
  "action": "workflow.open",
  "input": {
    "request": "Build an ERC-20 token called Tip Vault (symbol TIPV) with a fixed supply minted to the deployer, a full Foundry test suite and an independent review; deploy it; then publish a small website that shows the token, its supply and a connected wallet's balance.",
    "context": "Sepolia only. GitHub publication and IPFS hosting are approved. Keep the supply fixed; no owner mint.",
    "draft": {
      "objective": "Build the TIPV ERC-20 with tests and an independent review, deploy it, then build the website against the live deployment.",
      "shape": "chain",
      "onchain": "evm_project",
      "github": true,
      "ipfs": true,
      "contracts": ["TipVault"],
      "steps": [
        { "skill": "build-contract-project" },
        { "skill": "frontend-for-contract" },
        { "skill": "adversarial-review" }
      ]
    },
    "permissions": { "github": true, "ipfs": true, "onchain": { "kind": "evm_project", "chainId": 11155111 } }
  }
}
```

### A DAG with a site

```
{
  "request": "Release Tip Jar (TIPS): a fixed-supply ERC-20 and a TipJar contract that forwards ETH tips to a recipient, with invariant tests and an independent review; deploy both on Sepolia; then publish a one-page site to tip and read totals.",
  "context": "Sepolia only. GitHub and IPFS approved. Site name tip-jar. No owner, no admin, no upgrade.",
  "draft": {
    "objective": "Build TIPS and TipJar with tests and a review, deploy them, then build the tipping page against the live deployment.",
    "shape": "dag",
    "onchain": "evm_project",
    "github": true,
    "ipfs": "tip-jar",
    "contracts": ["TipsToken", "TipJar"],
    "references": ["solidity-security-review"],
    "steps": [
      { "skill": "build-contract-project", "key": "contracts", "dependsOn": [],
        "objective": "TipsToken and TipJar with a Foundry project.",
        "acceptanceCriteria": ["TipJar never holds ETH after a tip"] },
      { "skill": "write-foundry-tests", "key": "tests", "dependsOn": ["contracts"], "paths": ["test"],
        "objective": "Invariant and fuzz tests for TipJar." },
      { "skill": "adversarial-review", "key": "review", "dependsOn": ["tests"] },
      { "skill": "frontend-for-contract", "key": "site", "dependsOn": ["review"],
        "objective": "Connect a wallet, tip in ETH, show the recipient's total." }
    ]
  },
  "permissions": { "github": true, "ipfs": "tip-jar", "onchain": { "kind": "evm_project", "chainId": 11155111 } }
}
```

### How it runs

1. **contracts**: the contract steps run as the first job, a `launch.json` manifest is generated, and the review runs last.
2. **deployment**: the source is published to GitHub, rebuilt and attested, admitted, and deployed. The launch reads `live`.
3. **frontend**: a second job opens on the deployed commit. It reads the addresses, transactions and ABI hashes from `.imd/reads/deployment.json` and ships `dist/imd-deployment.json`.
4. **publishing**: the site's source goes to GitHub, the export is pinned to IPFS and named under ENS.
5. **validating**: the published bytes, deployment config, ABIs and onchain code are checked, retrying for up to a day while hosting settles (`waitingForHosting`).
6. **completed**. A release that later gives its site name to a newer one reads `superseded`. One that cannot finish reads `blocked` or `cancelled`.

### Admitted

```
GET /requests/ORDER_ID
{ "status": "admitted",
  "admission": { "action": "workflow.open",
    "result": { "kind": "workflow", "workflowId": "WORKFLOW_ID", "jobId": "CONTRACTS_JOB_ID",
                "statusUrl": "/workflows/WORKFLOW_ID", "jobUrl": "/jobs/CONTRACTS_JOB_ID" } } }
```

### Following it

```
GET /workflows/WORKFLOW_ID
{
  "id": "54934f3a-f063-4716-a1ad-24769bb0e815",
  "objective": "Release Time Lock (ERC-20 symbol LOCK, displayed as $LOCK) on Sepolia …",
  "status": "completed",
  "waitingForHosting": false,
  "failure": null,
  "chainId": 11155111,
  "contracts": { "id": "10ed3d00-…", "state": "completed", "failure": null,
    "repoUrl": "https://github.com/identity-md-launches/launch-113-timelocktoken-timelockbank",
    "commit": "ecdb4c30c7dbc745b597a496fc7b91f6097d3282" },
  "launch": { "id": "1d2a6994-…", "status": "live" },
  "handoff": { "version": 1, "launchId": "1d2a6994-…", "chainId": 11155111, "repoUrl": "…", "manifest": { … } },
  "frontendPlan": { "skill": "frontend-for-contract", "objective": "…", "acceptanceCriteria": [ … ] },
  "frontend": { "id": "83f492e5-…", "state": "completed", "failure": null, "repoUrl": "…", "commit": "43235f9d…" },
  "site": { "status": "named", "cid": "bafybeigpdjfjxxtupmoxs2d62vn4bp3lp2m6xew6xmx5kdsskbkgqy36f4",
            "ensName": "lock.site.identitymd.eth", "failure": null },
  "validation": { "status": "passed", "attempts": 3, "deadlineAt": "…", "nextAttemptAt": null,
    "report": { "status": "passed", "checks": [
      { "id": "deployment-config", "status": "passed", "detail": "…" },
      { "id": "static-assets", "status": "passed", "detail": "All 78 declared assets are reachable and match their SHA-256 digests." } ] } },
  "brief": "# Approved workflow …"
}
```

This is a real workflow on `api.imd.fun`, trimmed. Each stage's job is readable on its own through `/jobs/:id`; the launch through `/launches/:id`.
