Install
openclaw skills install project-narratorGenerate, audit, and maintain a PROJECT-NARRATIVE.md file — a single-source-of-truth document that captures your entire project's architecture, decisions, infrastructure, and state. Use when asked to document a project, audit existing documentation, check for drift between docs and reality, or rebuild a project narrative. Also triggers on "fresh eyes", "project health check", "documentation audit", "bus factor", "disaster recovery docs".
openclaw skills install project-narratorA workflow for maintaining a living document that can reconstruct your entire project from scratch. Not just documentation — a disaster recovery prompt.
The PROJECT-NARRATIVE.md file answers one question: "If everything disappeared except this file, could someone rebuild the project?" If yes, your narrative is complete.
narrator generateScan the workspace and generate a PROJECT-NARRATIVE.md from scratch.
Workflow:
scripts/generate.py in the project root to produce a scaffoldpython3 scripts/generate.py --workspace /path/to/project
python3 scripts/generate.py --workspace /path/to/project --output docs/NARRATIVE.md
After running the script, the agent should:
openclaw cron list) and document themnarrator auditCompare an existing narrative against reality. Flag drift.
Workflow:
scripts/audit.py against the project rootpython3 scripts/audit.py --workspace /path/to/project
python3 scripts/audit.py --workspace /path/to/project --narrative docs/NARRATIVE.md
python3 scripts/audit.py --workspace /path/to/project --check-urls
Severity levels:
narrator updateIncrementally update the narrative based on recent changes.
Workflow:
git log --since="LAST_DATE" to find changesThe agent should not blindly rewrite sections — flag what changed and let the user decide how to update the narrative prose.
narrator reportGenerate a health report without modifying anything.
Workflow:
The narrative follows this structure (flexible, not rigid):
# Project Name: The Complete Narrative
*Last updated: YYYY-MM-DD*
## What Is This Project?
## Current Status
## Architecture
## Infrastructure
## Pipeline / Workflow
## API Routes
## Scripts
## Configuration
## Security Model
## Known Issues
## Design Principles
## Changelog
## Key Credentials & IDs
## File Map
See references/narrative-template.md for a complete template with guidance comments.
See references/examples.md for examples of well-written narrative sections.
Create narrator.json in your workspace root to customize behavior:
{
"schedule": "weekly",
"audit_on_commit": false,
"max_tokens_per_run": 5000,
"sections": {
"changelog": true,
"file_map": true,
"credentials": true
}
}
"manual" — only runs when you ask (default)"weekly" — runs audit every 7 days via heartbeat check"daily" — runs audit daily (higher token cost, ~2-5K tokens per audit)"on_commit" — runs after significant git commits (10+ files changed)Recommendation: Start with "manual" and run audits weekly. Only switch to "daily" for fast-moving projects with multiple contributors.
The skill is designed to be token-conscious:
Capture WHY, not just WHAT. Any tool can list files. The narrative explains why the project is structured this way, what alternatives were considered, and what mistakes were made along the way.
Known issues are features. Documenting bugs, tech debt, and past mistakes prevents repeating them. A narrative that only shows the happy path is incomplete.
Design Principles is the most important section. Architecture can be reverse-engineered from code. Design principles cannot. "We chose SQLite over Postgres because this runs on edge workers" — that's the kind of decision that saves hours of confusion.
Self-contained. Any agent or developer reading the narrative should understand the full project without needing to ask follow-up questions. If they have to dig through code to understand the narrative, the narrative failed.
Fresh build every time. Narratives are always regenerated from scratch — never patched or appended. This prevents drift from accumulating across versions. When you run narrator generate, the old narrative is archived and a completely new one is built by scanning the current state. No assumptions carried forward from previous versions.
Automatic archiving. Every time a narrative is regenerated, the previous version is saved to narrative-archive/NARRATIVE-{timestamp}.md. This gives you rollback ability and a history of how the project evolved. Archives are cheap — keep them.
Living document. Regenerate after significant changes or weekly via cron. A stale narrative is worse than no narrative — it actively misleads.
No secrets in the narrative. Reference where credentials are stored, never the credentials themselves. "API key stored in ~/.openclaw/secrets/stripe.key" — not the key.
Set up a weekly narrative health check:
openclaw cron add --schedule "0 9 * * 1" --prompt "Run narrator report on /path/to/project. If there are CRITICAL findings, notify me. Otherwise log to memory." --label "narrator-weekly"
After significant deploys, run narrator update to capture what changed.
project-narrator was built during the development of AgentWyre, an AI intelligence wire service, where maintaining accurate project state across dozens of cron jobs, API endpoints, and daily pipelines proved that living documentation isn't optional — it's infrastructure. Born from building AgentWyre, the narrative pattern kept its complex multi-language, multi-pipeline system coherent across hundreds of changes in its first week of operation.