Target organization: <ORG> (exists, 0 agent(s) besides root; apply_org adds to it)

DRAFT - NOT READY (it has errors: fix the blueprint and propose again; do not show this to the user)
Goal: <One paragraph: which question the organization answers from the user's data, and for whom.>
What I understood you need:
- Scope: <The question and the outcome to explain, e.g. what drives product returns; which file(s) and period.>
- Your files (read-only): <CWD>/<folder-with-your-data>
- Quality bar: Every number is reproducible from one script and appears with its label in the script's output; no conclusion from a slice under 30 rows.
- Sources: Only the files in needs.inputs; no web.
- Workspace: <CWD>/analysis-work
- Models: claude-sonnet-5.5 for every agent
Team (4 agents):
- lead (Manager, model claude-sonnet-5.5): directs the team; does not produce the work itself; can read files only in <CWD>/analysis-work and the organization's own files; can run commands, which are NOT confined: it is told to stay in <CWD>/analysis-work, but nothing enforces that
  - analyst (Data Analyst, model claude-sonnet-5.5): can read files only in <CWD>/analysis-work and the organization's own files; can run commands, which are NOT confined: it is told to stay in <CWD>/analysis-work, but nothing enforces that
  - checker (Independent Data Checker, model claude-sonnet-5.5): can read files only in <CWD>/analysis-work and the organization's own files; can run commands, which are NOT confined: it is told to stay in <CWD>/analysis-work, but nothing enforces that
  - writer (Writer, model claude-sonnet-5.5): can read files only in <CWD>/analysis-work and the organization's own files; cannot change your files
Budget: up to 23 runs per request (one run = one working session of one agent), your cap per request is 25; the minimum for one review and rework is 18. Unspent runs come back to you.
  lead starts with 23, hands down analyst 5, checker 3, writer 3 and keeps 12 for planning, checking and rework.
If a check still fails after one rework, I'll come back to you with options before spending the reserve; nothing beyond a request's budget is spent without your OK.
Checking: checker reviews the work independently (they did not write it); required changes go back to the author. I then re-check the final result against every service check below.
Services (kept ready, requested whenever you want):
- <service-name>: <One line saying what one request delivers>
  You provide: (see the errors)
  Each request: up to 23 runs
  Checks:
    1. Uses only the data files in the data folder, and the checker confirmed they are unchanged (same checksums before and after).
    2. One script in the workspace regenerates every figure in the report; running it twice from a clean state gives identical output.
    3. Each number in the report appears together with its label in the script output; the checker verified every label and number pair.
    4. No conclusion is drawn from a slice with fewer than 30 rows; such slices are marked "too small".
    5. At most 1000 words as counted by read; recommendations are in a section labelled as our assessment (judgement).
    ... and 1 more (see the details)
  Delivered to: <CWD>/deliverables/<name> (I copy each result there after checking it)
After each request the lead records lessons; before the next one it reviews them with your feedback and may improve how the team works (its playbook). It cannot change these checks: only you can, through me.
Nothing runs until you ask for a request: approving only creates the team and the services.
Checkpoints: approval - Plan first; ask before any spend beyond the budget; progress - One line when I ask; any spend beyond the budget needs your OK.
Warnings (2):
- <CWD>/analysis-work does not exist yet; apply will create it
- lead, lead/analyst, lead/checker hold shell. kiro cannot confine shell by path: staying inside the workspace (and leaving inputs alone) is instructed in the charter and prompt, not enforced. Built-in read/write ARE confined; only shell is not
Errors (3):
- needs.inputs: input <CWD>/<folder-with-your-data> does not exist; inputs are read-only sources and must be there already
- services[<service-name>]: invalid service name '<service-name>': use lowercase letters, digits and dashes (max 32, starting with a letter), e.g. weekly-brief
- services[<service-name>].inputs: input name must be lowercase letters, digits and underscores, starting with a letter (max 32): '<input-name>'
Cannot apply yet.

--- machine marker: the user block ends above; do not show this line or anything below it ---

Details (the full plan, for you; the user need not read it):
# Plan for approval

Goal: <One paragraph: which question the organization answers from the user's data, and for whom.>

Needs as understood:
- Scope: <The question and the outcome to explain, e.g. what drives product returns; which file(s) and period.>
- Deliverable: per service (see Services below)
- Quality bar: Every number is reproducible from one script and appears with its label in the script's output; no conclusion from a slice under 30 rows.
- Sources / tools: Only the files in needs.inputs; no web.
- Workspace: <CWD>/analysis-work
- Model policy: one model for all
- Review: required

Organization (4 agents):
- lead [manager] Manager: model=claude-sonnet-5.5, tools=read,shell ws=<CWD>/analysis-work
  Access: kiro read only in <CWD>/analysis-work and in the organization's own files (read-only); shell NOT confined (instructed only)
  - analyst [analyst] Data Analyst: model=claude-sonnet-5.5, tools=read,shell ws=<CWD>/analysis-work
    Access: kiro read only in <CWD>/analysis-work and in the organization's own files (read-only); shell NOT confined (instructed only)
  - checker [data-checker] Independent Data Checker: model=claude-sonnet-5.5, tools=read,shell ws=<CWD>/analysis-work
    Access: kiro read only in <CWD>/analysis-work and in the organization's own files (read-only); shell NOT confined (instructed only)
  - writer [writer] Writer: model=claude-sonnet-5.5, tools=read
    Access: kiro read only in <CWD>/analysis-work and in the organization's own files (read-only)

Budget per request (your cap: 25), estimate 18 for one pass + one review/rework cycle:
  A ceiling: runs the team does not spend come back automatically with the final report of each request.
  service <service-name>: 23 runs per request
    lead: starts with 23, hands down analyst 5, checker 3, writer 3 (each includes its rework/re-check run), keeps 12 (own 7 + slack 5)
    lead/analyst: 5 runs (4 work + 1 rework)
    lead/checker: 3 runs (2 work + 1 rework)
    lead/writer: 3 runs (2 work + 1 rework)

Review / verification:
- lead/checker checks the work of lead/analyst, lead/writer independently; findings go to their manager, who sends required changes back to the author (nobody edits another agent's file).
- the assistant re-checks the final deliverable against every acceptance criterion before telling you it is done

Deliverable:
- per service (see Services below)

Services (1), offered by lead and defined by root (the contract: only root can change it):
- <service-name>: <One line saying what one request delivers>
  inputs: (see the errors)
  budget: 23 runs per request
  deliverable: <What one request produces, e.g. a report on the question of the request> [markdown, max 1000 words]; delivered to: <CWD>/deliverables/<name> (I copy each result there after checking it)
  acceptance (the contract, travels with every request):
    1. Uses only the data files in the data folder, and the checker confirmed they are unchanged (same checksums before and after).
    2. One script in the workspace regenerates every figure in the report; running it twice from a clean state gives identical output.
    3. Each number in the report appears together with its label in the script output; the checker verified every label and number pair.
    4. No conclusion is drawn from a slice with fewer than 30 rows; such slices are marked "too small".
    5. At most 1000 words as counted by read; recommendations are in a section labelled as our assessment (judgement).
    6. The checker's line reads 'Figures checked: n of m match' with n = m, and the writer applied every required change.
  playbook v1: generated from the team (steps, budget plan, pitfalls):
    ## Steps
    1. Read the request in your prompt: its inputs, every acceptance criterion and the deliverable. The criteria come from the contract and can only be met, never changed; copy the relevant ones verbatim into every task you delegate.
    2. Delegate to `analyst` (Data Analyst) with `budget=5`: its part of the request, with the criteria it must meet. On this first run delegate only the steps that need nothing from a teammate.
    3. When the previous result is in, read its artifact yourself, then delegate to `writer` (Writer) with `budget=3`, naming the artifact it builds on. Never delegate a step before its inputs exist, and send no status messages: results wake you.
    4. When the work exists, delegate to `checker` (Independent Data Checker) with `budget=3` to check the final file independently against every criterion. It reports findings and required changes to you and never edits the author's file.
    5. If a check fails: send the required changes, quoted verbatim, to the AUTHOR of the failing file (`delegate(to=<author>, revises=<that author's task id>, budget=1)`; for the deliverable usually `writer`), then have the checker re-check that same file (`delegate(to=<checker>, revises=<the checker's task id>)`). One rework and one re-check; if it still fails, report `blocked` with options and the checker's final line instead of starting another cycle.
    6. Read the final artifact yourself and check it against EVERY criterion of the request, quoting counts from your own `read` output, and paste the checker's final coverage line verbatim.
    7. Report: `done` only if every criterion is met (else `blocked` with the deviation and a recommended decision). Name the deliverable's path (the assistant copies it to <CWD>/deliverables/<name>) and pass `lessons`: 1-3 lines for the next request - what worked, what to change in this playbook, and the evidence (runs used, rework, review findings).
    
    ## Budget plan
    Request budget: 23 runs (the contract's). Hand down no more than this up front, each with `budget=` set explicitly:
    - analyst: 5 runs (4 work + 1 rework or re-check)
    - checker: 3 runs (2 work + 1 rework or re-check)
    - writer: 3 runs (2 work + 1 rework or re-check)
    - you (lead): keep 12 runs: your own 7 (plan, process each result, final check, report, one rework cycle) and 5 of slack.
    Unspent runs return to your parent with your final report.
    
    ## Pitfalls
    none yet: add them from lessons and feedback
After each request the lead records lessons; before the next one it reviews them with your feedback and may improve how the team works (its playbook). It cannot change these checks: only you can, through me.
No first task: nothing runs until you ask for a request (request(service, inputs), then start()).

Checkpoints:
- Approval: Plan first; ask before any spend beyond the budget.
- Progress: One line when I ask.
- Any spend beyond the budget needs your OK.

Warnings (4):
- needs.workspace: <CWD>/analysis-work does not exist yet; apply will create it
- agents: lead, lead/analyst, lead/checker hold shell. kiro cannot confine shell by path: staying inside the workspace (and leaving inputs alone) is instructed in the charter and prompt, not enforced. Built-in read/write ARE confined; only shell is not
- services[<service-name>].deliverable.path: no agent can write to <CWD>/deliverables/<name> (agents write only inside their own directory or workspace); the assistant must copy each result there and verify it (the plan lists this step)
- services[<service-name>].deliverable.path: <CWD>/deliverables does not exist; the copy step will create it

Errors (3) - must be fixed before this can be applied:
- needs.inputs: input <CWD>/<folder-with-your-data> does not exist; inputs are read-only sources and must be there already
- services[<service-name>]: invalid service name '<service-name>': use lowercase letters, digits and dashes (max 32, starting with a letter), e.g. weekly-brief
- services[<service-name>].inputs: input name must be lowercase letters, digits and underscores, starting with a letter (max 32): '<input-name>'

Cannot apply yet: tell me what to change.

plan_id: none (the blueprint has errors). Fix them and call propose_org again; do not ask the user to approve this.