8000 GitHub - rezkam/storyof Β· GitHub
[go: up one dir, main page]

Skip to content
rezkamPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

StoryOf

Test Release npm version npm downloads License

Run storyof in any project and an AI agent reads your codebase, generates a rich HTML architecture doc with mermaid diagrams, then stays around as a chat partner you can ask questions about the code.

You join a new project. There's no architecture doc. The README says "see the code." You spend half a day clicking through files trying to understand how anything connects to anything.

StoryOf fixes that. It spawns an AI agent that reads your entire codebase, builds a mental model of the architecture, and writes it up as a rich HTML document with mermaid diagrams, module breakdowns, data flow explanations, and real code walkthroughs. You watch it happen live in your browser.

But the document is just the starting point. Once the agent has explored the codebase, it stays around as a knowledgeable colleague. The chat sidebar lets you ask follow-up questions, dig into specifics, or ask it to explain something differently. The agent already has context from reading the actual source, so the conversation is grounded in what's really in the code, not hallucinated guesses.

See It in Action

Here's StoryOf exploring karpathy/nanochat β€” a full-stack ChatGPT clone covering tokenization, pretraining, fine-tuning, RL, and serving.

Architecture Document with Diagrams

The left panel shows the generated document. The right panel shows the agent's activity β€” file reads, tool calls, validation status.

Architecture overview with pipeline diagram

Mermaid Diagrams Generated from Code

Flowcharts, state diagrams, and decision trees β€” all generated by reading the actual source, not from comments or docs.

Flash attention decision flowchart

Code Walkthroughs with Syntax Highlighting

Real code from the codebase with inline explanations of what it does and why.

Code walkthrough with syntax highlighting

Chat with Rich Responses

Ask follow-up questions after the document is generated. The agent responds with markdown tables, code blocks, and structured explanations.

Chat response with tables and code

Chat response continued β€” comparison table

Install

Standalone CLI

npm install -g storyof

Tab Completion (Optional)

Enable shell completion for commands, providers, and flags:

# Bash
storyof completion bash >> ~/.bashrc
source ~/.bashrc

# Zsh
storyof completion zsh > ~/.zsh/completions/_storyof
# Or for Oh My Zsh: storyof completion zsh > ~/.oh-my-zsh/completions/_storyof

# Fish
storyof completion fish > ~/.config/fish/completions/storyof.fish

After installing, you can tab-complete:

  • Commands: storyof auth <TAB>
  • Providers: storyof auth set <TAB>
  • OAuth providers: storyof auth login <TAB>
  • Flags: storyof --<TAB>

Quick Start

storyof

That's it. A browser tab opens with a split-panel UI. The agent starts reading your codebase and generating the document on the left. The URL and session token are printed in your terminal. Paste the token in the browser to connect.

What You Get

Architecture Document (left panel)

  • Mermaid diagrams: system architecture, data flows, sequence diagrams, state machines β€” all generated from the actual code
  • Syntax-highlighted code blocks: real code from your codebase with explanations of what it does and why
  • Metrics cards: lines of code, file counts, language, key stats at a glance
  • Sticky navigation: jump between sections, wraps responsively on narrow viewports
  • Dark theme: designed for developers who live in dark mode

Live Chat (right panel)

  • Ask anything about the codebase β€” the agent has already read the files
  • Select text from the document, click "πŸ“Ž Ask about this" to use it as context
  • Rich responses: tables, code blocks, headings, bold/italic, bullet lists β€” all rendered inline
  • Streaming: watch the response arrive word by word
  • Token usage & costs: see per-request and session-total token counts and estimated costs

Reliability

  • Auto-restart: if the agent crashes, it restarts automatically (up to 3 times with exponential backoff)
  • Health monitoring: server pings the agent every 15s; if it stops responding, the UI shows "Unresponsive" immediately
  • Mermaid validation: every diagram is validated with mermaid-cli; broken diagrams get sent back to the agent to fix automatically (up to 3 cycles)
  • Session persistence: stop and come back later with storyof resume

Usage