Metadata-Version: 2.4
Name: narrative-craft
Version: 0.2.0
Summary: A standalone five-phase story development, critique, revision, and verification toolkit.
Project-URL: Homepage, https://github.com/clchinkc/narrative-craft
Project-URL: Repository, https://github.com/clchinkc/narrative-craft
Project-URL: Issues, https://github.com/clchinkc/narrative-craft/issues
Author: Kevin Chin
License: MIT License
        
        Copyright (c) 2026 Kevin Chin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing
Requires-Python: >=3.10
Requires-Dist: jsonschema>=4.20
Requires-Dist: opencc>=1.1.9
Requires-Dist: pyyaml>=6.0
Description-Content-Type: text/markdown

# Narrative Craft

Narrative Craft is a standalone, local-first toolkit for shaping, drafting,
critiquing, revising, verifying, and exporting stories. It provides a Python
package, a `narrative-craft` CLI, an installable agent skill, versioned schemas,
and English, Traditional Chinese, and mixed-language examples.

Narrative Craft has no required service, agent framework, repository checkout, or
rendering system. External tools integrate only through public artifacts in
`.narrativecraft/` or the `narrative_craft.extensions` capability protocols.

## Install

```bash
uv tool install narrative-craft
# or
pipx install narrative-craft
# or
pip install narrative-craft
```

Development checkout:

```bash
git clone https://github.com/clchinkc/narrative-craft.git
cd narrative-craft
uv sync
uv run narrative-craft doctor
```

Python 3.10–3.13 is supported.

## Quick start

```bash
mkdir my-story && cd my-story
narrative-craft init --id my-story --title "My Story" --manuscript en
narrative-craft status
narrative-craft lint --file scene-1.md --lang en
narrative-craft assess setup --state .narrativecraft/state.json --round 1
narrative-craft critique setup --state .narrativecraft/state.json --round 1 --all
narrative-craft loop kickoff
narrative-craft verify --state .narrativecraft/state.json --round 1 --diagnostic CD-1-1
narrative-craft export ao3 --state .narrativecraft/state.json --out export
```

Use `--manuscript zh-Hant` for Traditional Chinese or `mixed` for bilingual
prose. Run `narrative-craft help` for the complete command tree and
`narrative-craft doctor` after installation.

## Five phases

1. SHAPE establishes intent, structure, characters, world rules, themes, and
   author-owned constraints.
2. BUILD+LINT drafts scenes and runs deterministic checks.
3. POLISH improves prose without silently changing author intent.
4. CRITIQUE creates a neutral review packet, accepts native or external
   normalized findings, and routes accepted findings.
5. PUBLISH verifies frozen lines and prepares an export. Publishing itself is
   always an author action.

The 13-step optimization loop is a meta-cycle over these five phases; it is not
a sixth phase. See [docs/optimization-loop.md](docs/optimization-loop.md).

## Workspace and public artifacts

`narrative-craft init` creates:

```text
.narrativecraft/
├── state.json
├── events.jsonl
├── review-packet.json
├── review-findings.json
├── gate-packet.json
├── verification.json
├── report.json
├── handoff.md
├── backups/
└── passes/
```

Validate an artifact or the whole workspace:

```bash
narrative-craft validate --schema report --path .narrativecraft/report.json
narrative-craft validate --workspace .
```

Schemas are in [`schemas/`](schemas/); valid samples are in
[`examples/contracts/`](examples/contracts/). Unknown integration data belongs
under each artifact's `extensions` object.

## Documentation

- [Installation](docs/installation.md)
- [Quick start](docs/quick-start.md)
- [Pipeline](docs/pipeline.md)
- [Optimization loop](docs/optimization-loop.md)
- [Locales and bilingual workflows](docs/locale.md)
- [Native critique](docs/native-critique.md)
- [Author gates](docs/author-gates.md)
- [Failure modes](docs/failure-modes.md)
- [Falsification and rollback](docs/falsification-rollback.md)
- [State format](docs/state-format.md)
- [Extension contracts](docs/extension-contracts.md)
- [Versioned schema index](docs/schema-index.md)
- [Migration from the embedded implementation](docs/migration-from-plan1.md)
- [Release process](docs/release.md)

## Repository layout

```text
src/narrative_craft/       Python package and CLI
skills/narrative-craft/    independently installable agent skill
spec/                  optimization and locale specifications
schemas/               public JSON Schema contracts
assets/                runtime rubric and templates
docs/                  user and extension documentation
examples/              English, Traditional Chinese, mixed, and failure examples
tests/                 independent package and workflow tests
```

## Development

```bash
uv sync
uv run pytest -q
uv run ruff check .
uv build
```

See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).

## License

MIT. See [LICENSE](LICENSE).
