@abarcenas/ai-writer 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/AGENTS.md +74 -0
  2. package/package.json +27 -0
package/AGENTS.md ADDED
@@ -0,0 +1,74 @@
1
+ # ai-writer
2
+
3
+ Orchestrator agent and data toolkit for maintaining writing consistency across literary projects. Distributed as an npm package — installed per-project to provide agent instructions, a structured data directory, and helper scripts.
4
+
5
+ ## How it works
6
+
7
+ An orchestrator agent (OpenAI-based) runs whenever the user creates literary work. It reads/writes structured project data stored as JSON + Markdown inside the target writing project.
8
+
9
+ ## Data directory (`_writer/`)
10
+
11
+ All project-scoped data lives in a `_writer/` directory at the project root. Managed by the agent — the writer never edits it directly.
12
+
13
+ | Path | Format | Purpose |
14
+ |------|--------|---------|
15
+ | `_writer/quirks.json` | JSON | Character & narrative quirks — each is a rich object with name, description, examples, category, tags, status, created/updated dates |
16
+ | `_writer/styles.json` | JSON | Voice, tense, POV, tone rules — same rich-object shape |
17
+ | `_writer/glossary.json` | JSON | Terms, names, places — with aliases, first-used, notes |
18
+ | `_writer/characters/` | Markdown | One file per character — prose sheets with biography, arc, relationships |
19
+ | `_writer/chapters/` | Markdown | Per-chapter notes, outlines, revision history |
20
+ | `_writer/config.json` | JSON | Project-level config (agent persona, enabled checks, export settings) |
21
+
22
+ ## Record schema (rich object)
23
+
24
+ Every quirk/style/glossary entry:
25
+
26
+ ```json
27
+ {
28
+ "id": "uuid",
29
+ "name": "short label",
30
+ "description": "what it is",
31
+ "examples": ["passage that illustrates it"],
32
+ "category": "character|voice|plot|setting|...",
33
+ "tags": ["optional", "taxonomy"],
34
+ "status": "active|deprecated|superseded",
35
+ "supersededBy": null,
36
+ "created": "ISO date",
37
+ "updated": "ISO date"
38
+ }
39
+ ```
40
+
41
+ ## Agent responsibilities
42
+
43
+ ### Primary agent
44
+
45
+ **`writer`** (`.opencode/agents/writer.md`) — Orchestrator and intent router. Switch to it via Tab. Routes questions to the correct sub-agent, runs full analysis pipeline when a file is dropped, compiles reports, and applies approved inline edits.
46
+
47
+ ### Sub-agents
48
+
49
+ | Agent | File | Purpose |
50
+ |-------|------|---------|
51
+ | `@sentiment` | `.opencode/agents/sentiment.md` | Analyzes tone, formality, emotional valence per paragraph |
52
+ | `@grammar-nazi` | `.opencode/agents/grammar-nazi.md` | Flags grammar, punctuation, vocabulary issues — respects tone context |
53
+ | `@coherency` | `.opencode/agents/coherency.md` | Scores paragraph-to-paragraph coherence (0-100), detects topic drift |
54
+
55
+ ### Lifecycle hooks
56
+
57
+ - **writer-memory skill** (`.opencode/skills/writer-memory/SKILL.md`) — loads `_writer/` data on session start, monitors for contradictions, collects observations from writer agent at session end, persists new/updated records.
58
+
59
+ ## Conventions
60
+
61
+ - CommonJS (`"type": "commonjs"`)
62
+ - JSON for structured records; Markdown for prose/notes
63
+ - All timestamps in ISO 8601
64
+
65
+ ## Status
66
+
67
+ No source files yet — install dependencies with `npm install <pkg>` before coding.
68
+
69
+ ## Commands
70
+
71
+ | Command | Use |
72
+ |---------|-----|
73
+ | `npm test` | placeholder (override once tests exist) |
74
+ | `npm publish` | publish to npm (configure version bump manually) |
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@abarcenas/ai-writer",
3
+ "version": "1.0.2",
4
+ "description": "Orchestrator agent and data toolkit for maintaining writing consistency across literary projects",
5
+ "license": "ISC",
6
+ "author": "",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "files": [
10
+ "index.js",
11
+ "AGENTS.md"
12
+ ],
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/abarcenas29/ai-writer.git"
19
+ },
20
+ "scripts": {
21
+ "test": "echo \"Error: no test specified\" && exit 1",
22
+ "prepare": "husky"
23
+ },
24
+ "devDependencies": {
25
+ "husky": "^9.1.0"
26
+ }
27
+ }