Skip to content
Back to skills

Writing Runner

ASecurity

Compose Writing orchestrator.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 2, 2026
ai-agentspythonbash

Security analysis

A100/100

Scanned October 5, 2026

npx -y skills add lulufoo/lulu-workflow --skill writing-runner --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Writing Runner?

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

Security grade badge for Writing Runner
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lulufoo-writing-runner/badge)](https://www.skillsdirectory.com/skills/lulufoo-writing-runner)

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: writing-runner
description: >-
  Compose Writing orchestrator.
---

# writing-runner

Turn producer-written facts into a validated compose draft document.

## Scope

Fact production belongs to Inductive|Deductive (`inductive-runner` or
`deductive-runner`).

- **Must:** validate producer-written `_facts.json`.
- **Must not:** invent beyond facts; decide open choices.

## Parent-Provided Inputs

| Variable | Purpose |
|---|---|
| `$REVISION_DIR` | Absolute path to `revision{N}/` |
| `$SCOPE_REF_PATH` | Absolute path to compose scope SSOT (Return echo only) |
| `$OUTPUT_DOC_PATH` | Absolute path to output document (design-doc.md or tech-doc.md); fallback `{REVISION_DIR}/tech-doc.md` when omitted |
| `$CYCLE_TYPE` | `feature` |
| `$CYCLE_ID` | Active cycle id |
| `$CODE_GROUNDING` | Boolean from `enter-writing` stdout |

## Script Macros

| Macro | Command |
|-------|---------|
| `$WRITING_COMPOSE_VALIDATE` | `python3 "$SKILL_ROOT/compose/scripts/writing/compose_writing_control.py" validate --revision-dir "$REVISION_DIR" --compose-doc "$OUTPUT_DOC_PATH"` |
| `$FACTS_CTL` | `python3 "$SKILL_ROOT/compose/scripts/facts/facts_control.py"` |
| `$NARRATIVE_ARC_CTL` | `python3 "$SKILL_ROOT/compose/narrative-arc-runner/scripts/narrative_arc_control.py"` |

`$FACTS_CTL` subcommands used here: `--help` · `validate` · `status`.

`$NARRATIVE_ARC_CTL` subcommands: `--help` · `validate` · `write` · `show` · `list-chapters`.

## Execution

### Step 1 — Load

1. Bind Parent Inputs (`$REVISION_DIR`, `$OUTPUT_DOC_PATH`, `$CYCLE_ID`, `$SCOPE_REF_PATH` path hold, `$CODE_GROUNDING`).

**Done:** Parent required Inputs bound; `$CODE_GROUNDING` boolean set. Proceed to Step 2.

### Step 2 — Validate facts

Producer already wrote `_facts.json`. Only validate:

```bash
$FACTS_CTL validate \
  --revision-dir "$REVISION_DIR" \
 
```

Missing / invalid `_facts.json` → Blocking (return to producer; never re-atomize from scope).

Topology change → new revision + re-run Inductive|Deductive then Writing.

**Done:** validate exit 0 → proceed to Step 3.

### Step 3 — Narrative arc

Dispatch sibling `narrative-arc-runner` via `$SUBAGENT_TOOL`, then
`$SUBAGENT_AWAIT_SYNC`.

```text
Load {SKILL_ROOT}/compose/narrative-arc-runner/SKILL.md and follow its Run.

## Input
REVISION_DIR: <$REVISION_DIR>
CYCLE_ID: <$CYCLE_ID>
OUTPUT_PATH: _narrative-arc.json
```

### Step 4 — Validate narrative arc

```bash
$NARRATIVE_ARC_CTL validate \
  --revision-dir "$REVISION_DIR" \
  --output-path "_narrative-arc.json" \
  --require-write-ready
```

Exit 0 → proceed.
Non-zero → present `$NARRATIVE_ARC_CTL` stderr and exit code to the
parent / human; **stop** Writing.

### Step 5 — Chapter write + assemble

Dispatch sibling `chapter-write-runner` via `$SUBAGENT_TOOL`, then
`$SUBAGENT_AWAIT_SYNC`.

```text
Load {SKILL_ROOT}/compose/chapter-write-runner/SKILL.md and follow
references/write-protocol.md then contracts/delivery.md

## Input
REVISION_DIR: <$REVISION_DIR>
CYCLE_ID: <$CYCLE_ID>
OUTPUT_DOC_PATH: <$OUTPUT_DOC_PATH>
ARC_PATH: _narrative-arc.json
```

### Step 6 — Validate

Run `$WRITING_COMPOSE_VALIDATE` (prefers `_narrative-arc.json` SoT: arc validity + chapter artifacts + L6; rejects retired `_chapters.json`).

On failure → present `$WRITING_COMPOSE_VALIDATE` stderr and exit code to the
parent / human; **stop** Writing.
On success → Return Summary.

**Done:** `$WRITING_COMPOSE_VALIDATE` exit 0.

## Return Summary

```text
Writing complete.
  Output: <OUTPUT_DOC_PATH>
  Facts: <REVISION_DIR>/_facts.json (<N> facts; producer-written, validate-only)
  Narrative arc: <REVISION_DIR>/_narrative-arc.json (status=write_ready; <N> sub-topic chapters)
  Chapter artifacts: <REVISION_DIR>/_body-*.txt
  Write-state: <REVISION_DIR>/_chapter-write-state.json (status=complete)
  Scope cross-check: <SCOPE_REF_PATH>
  Draft status: Written
  Next step: parent pause gate (`$POST_WRITING_OPTIONS`)
```

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.

Comments

Loading comments…

Newsletter

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