Skip to content
docs-updater logo

Docs Updater

docs-updater

Expert assistant for keeping documentation synchronized with code changes in the KR92 Bible Voice project. Use when updating API docs, maintaining architecture diagrams, syncing README, updating CLAUDE.MD, or generating documentation from code.

SKILL.md

Full skill instructions

Docs Updater

Capabilities

  • Update API docs when schemas change
  • Maintain architecture diagrams
  • Sync README with actual features
  • Ensure CLAUDE.MD stays current
  • Generate documentation from code

Documentation Files

FilePurposeUpdate When
CLAUDE.MDAI context docMajor architecture changes
README.mdProject overviewFeature changes, setup changes
Docs/​01-PRD.mdProduct requirementsVision or scope changes
Docs/​02-DESIGN.mdArchitectureSystem design changes
Docs/​03-API.mdAPI contractsDatabase/​RPC/​Edge Function changes
Docs/​04-DEV-WORKFLOW.mdDev processWorkflow or CI/​CD changes
Docs/​05-DEV.mdBible lookupsRPC function changes
Docs/​06-AI-ARCHITECTURE.mdAI systemAI feature or prompt changes
Docs/​07-ADMIN-GUIDE.mdAdmin panelAdmin feature changes
Docs/​08-WIDGET.mdWidget docsWidget API or features changes

Usage Examples

Example 1: Update API Docs After Schema Change

User: "I added a new table 'user_study_plans'. Update the docs."

Assistant:

Update Docs/​03-API.md:

### User Data Tables (public)
| Table | Primary Key | Notes |
|-------|-------------|-------|
| `profiles` | `id` (UUID) | User profiles with preferences |
| `bookmarks` | `id` (UUID) | User bookmarks (RLS enabled) |
| `highlights` | `id` (UUID) | User highlights with color (RLS enabled) |
| `user_study_plans` | `id` (UUID) | **NEW** User-created Bible study plans (RLS enabled) |
| ... | ... | ... |

### User Data

**NEW** Study Plans:
\`\`\`sql
-- Get user's study plans
get_user_study_plans(p_user_id)

-- Create study plan
create_study_plan(p_title, p_description, p_duration_days)

-- Add chapter to plan
add_plan_chapter(p_plan_id, p_book_name, p_chapter_number, p_day_number)
\`\`\`

Update Docs/​02-DESIGN.md:

### User Data Tables (public)
\`\`\`sql
profiles(id, user_id, display_name, email, audio_enabled)
bookmarks(id, user_id, verse_id, osis, chapter_id)
highlights(id, user_id, verse_id, color, tags)
user_study_plans(id, user_id, title, description, duration_days, created_at)  # NEW
plan_chapters(id, plan_id, book_name, chapter_number, day_number, completed)  # NEW
\`\`\`

Update CLAUDE.MD:

### Database Schemas

**public** - User data and application tables:
- `profiles`, `user_roles`, `bookmarks`, `highlights`
- `user_study_plans`, `plan_chapters` # NEW - Bible study planning
- ...

Example 2: Document New RPC Function

User: "Created RPC function search_user_content(query, user_id). Document it."

Assistant:

Add to Docs/​03-API.md:

### User Content Search

**NEW** Search across user's bookmarks, highlights, and notes:
\`\`\`sql
search_user_content(p_query TEXT, p_user_id UUID DEFAULT auth.uid(), p_limit INT DEFAULT 50)
→ [{
  content_type TEXT,           -- 'bookmark', 'highlight', 'note'
  verse_id UUID,
  osis TEXT,
  verse_text TEXT,
  note_text TEXT,              -- NULL for bookmarks/​highlights
  highlight_color TEXT,        -- NULL for bookmarks/​notes
  created_at TIMESTAMPTZ,
  rank REAL                    -- Full-text search rank
}]
\`\`\`

**TypeScript:**
\`\`\`typescript
const { data } = await supabase.rpc('search_user_content', {
  p_query: 'grace faith',
  p_limit: 20
});
\`\`\`

Add to Docs/​05-DEV.md:

### search_user_content — Search User Content

\`\`\`sql
SELECT * FROM public.search_user_content(
  p_query := 'grace',
  p_user_id := auth.uid(),
  p_limit := 50
);
\`\`\`

**Returns:** Combined results from bookmarks, highlights, and notes with full-text search ranking.

Example 3: Update Architecture Diagram

User: "Added new Edge Function 'generate-study-plan'. Update architecture docs."

Assistant:

Update Docs/​02-DESIGN.md:

### Edge Functions

Location: `supabase/​functions/`

| Function | Auth | Purpose |
|----------|------|---------|
| `ai-orchestrator` | JWT | Central AI routing with usage logging |
| `translate-search-term` | Public | FI↔EN term translation for search |
| `generate-study-plan` | JWT | **NEW** AI-powered study plan generation |
| `generate-audio` | JWT | ElevenLabs TTS generation |
| ... | ... | ... |

Update architecture diagram:

## AI Integration Flow

\`\`\`
1. User requests study plan
       │
       ▼
2. Frontend calls Edge Function
       │
       ▼
3. Edge Function:
   ├── Fetch feature config (vendor/​model)
   ├── Fetch prompt template from DB
   ├── Render prompt with user preferences
   ├── Call AI provider
   ├── Parse structured study plan
   ├── Save to database
   ├── Log usage to ai_usage_logs
   └── Return plan to user
       │
       ▼
4. Frontend displays plan with chapters
\`\`\`

Example 4: Sync README with Features

User: "Audio feature now supports playback speed control. Update README."

Assistant:

Update README.md:

## Key Features

- Multi-version Bible reader (KR92/​STLK 2017, 1933/​38, KJV with Strong's)
- Full-text search and Strong's Concordance lookup
- AI-powered search term translation (Finnish ↔ English)
- AI summaries and contextual analysis
- Topic explorer with cross-references
- Audio Bible with ElevenLabs TTS **← Updated**
  - **NEW:** Playback speed control (0.5x - 2.0x)
  - **NEW:** Skip forward/​backward 10 seconds
  - Chapter-by-chapter playback with verse sync
- User accounts with bookmarks and highlights
...

Example 5: Generate API Documentation from Code

User: "Generate API documentation for the new Edge Function"

Assistant:

Create documentation from Edge Function code:

// supabase/​functions/​generate-study-plan/​index.ts

/​**
 * Generate Study Plan Edge Function
 *
 * Creates an AI-powered Bible study plan based on user preferences.
 *
 * @endpoint POST /​functions/​v1/​generate-study-plan
 * @auth JWT required
 *
 * @request
 * {
 *   duration_days: number,      // Plan duration (7-90 days)
 *   focus_topic?: string,        // Optional topic focus
 *   books?: string[],           // Optional book preferences
 *   daily_chapters?: number     // Chapters per day (1-5)
 * }
 *
 * @response
 * {
 *   success: boolean,
 *   plan: {
 *     id: string,
 *     title: string,
 *     description: string,
 *     duration_days: number,
 *     chapters: [{
 *       day_number: number,
 *       book_name: string,
 *       chapter_number: number,
 *       reason: string            // AI-generated explanation
 *     }]
 *   },
 *   metadata: {
 *     model: string,
 *     latencyMs: number,
 *     tokens: number
 *   }
 * }
 *
 * @example
 * const { data } = await supabase.functions.invoke('generate-study-plan', {
 *   body: {
 *     duration_days: 30,
 *     focus_topic: 'grace',
 *     daily_chapters: 2
 *   }
 * });
 */

Generate markdown documentation:

## Edge Function: generate-study-plan

**Endpoint:** `POST /​functions/​v1/​generate-study-plan`
**Authentication:** JWT required
**Purpose:** Generate AI-powered Bible study plans

### Request Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `duration_days` | number | Yes | Plan duration (7-90 days) |
| `focus_topic` | string | No | Optional topic focus |
| `books` | string[] | No | Optional book preferences |
| `daily_chapters` | number | No | Chapters per day (1-5, default: 2) |

### Response

\`\`\`json
{
  "success": true,
  "plan": {
    "id": "uuid",
    "title": "30-Day Grace Study",
    "description": "AI-generated study plan focusing on grace",
    "duration_days": 30,
    "chapters": [
      {
        "day_number": 1,
        "book_name": "Romans",
        "chapter_number": 3,
        "reason": "Introduces foundational concepts of grace"
      }
    ]
  },
  "metadata": {
    "model": "google/​gemini-2.5-flash",
    "latencyMs": 2341,
    "tokens": 1523
  }
}
\`\`\`

### Usage Example

\`\`\`typescript
const { data, error } = await supabase.functions.invoke('generate-study-plan', {
  body: {
    duration_days: 30,
    focus_topic: 'grace',
    daily_chapters: 2
  }
});

if (error) throw error;
console.log('Generated plan:', data.plan);
\`\`\`

Documentation Checklist

When making changes, update docs in this order:

1. Code Changes

  • Write code
  • Add JSDoc/​comments
  • Add TypeScript types

2. API Documentation (if applicable)

  • Update Docs/​03-API.md with new tables/​functions
  • Add request/​response examples
  • Document error cases

3. Architecture Documentation (if applicable)

  • Update Docs/​02-DESIGN.md with architectural changes
  • Update diagrams
  • Document new patterns

4. Usage Documentation

  • Update relevant guide (05-DEV.md, 06-AI-ARCHITECTURE.md, etc.)
  • Add usage examples
  • Update best practices

5. User-Facing Documentation

  • Update README.md for feature changes
  • Update Docs/​07-ADMIN-GUIDE.md for admin features
  • Update Docs/​08-WIDGET.md for widget changes

6. AI Context

  • Update CLAUDE.MD for major changes
  • Keep schema reference current
  • Update common patterns

Documentation Quality Standards

Good Documentation

  • ✅ Clear and concise
  • ✅ Includes examples
  • ✅ Explains the "why" not just "what"
  • ✅ Up-to-date with code
  • ✅ Covers error cases
  • ✅ Uses consistent formatting

Bad Documentation

  • ❌ Outdated information
  • ❌ No examples
  • ❌ Vague descriptions
  • ❌ Missing error handling
  • ❌ Inconsistent formatting
  • ❌ Missing type information

Automation Opportunities

Create documentation generation scripts:

// scripts/​generate-api-docs.ts
// Reads database schema and generates API documentation

import { createClient } from '@supabase/​supabase-js';

async function generateTableDocs() {
  const supabase = createClient(url, key);

  const { data: tables } = await supabase
    .from('information_schema.tables')
    .select('table_name, table_schema');

  // Generate markdown for each table
  // ...
}

Related Documentation

All documentation files are interconnected - changes often need updates across multiple files.

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
A
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View