Skip to content

Add DTPR Studio — taxonomy management tool#254

Open
pichot wants to merge 3 commits intomainfrom
worktree-studio
Open

Add DTPR Studio — taxonomy management tool#254
pichot wants to merge 3 commits intomainfrom
worktree-studio

Conversation

@pichot
Copy link
Member

@pichot pichot commented Mar 3, 2026

Summary

  • New studio/ package: Nuxt 4 + Nuxt UI v4 web app and CLI for managing the DTPR taxonomy
  • Reads/writes markdown files in app/content/dtpr.v1/ directly via a ContentProvider interface (designed for future GitHub API integration)
  • Dashboard with stats, gap analysis, translation coverage bars, and category balance
  • Element browser/editor with multi-locale tabs, category browser, translation matrix, icon grid
  • AI integration: Claude API for translations, Recraft AI for SVG icon generation
  • CLI tools: gaps, validate, translate, icons
  • Git status and commit endpoints for workflow integration

What's included

Web UI (SPA on port 3001)

  • Dashboard — element/category/locale/icon counts, gap summary, translation coverage per locale, category balance
  • Element browser — filter by category, datachain type, search text, icon status; multi-locale editor with save
  • Category browser — grouped by datachain type, detail view with element list
  • Translation manager — matrix view (elements × locales), bulk select + "Translate with Claude" action
  • Icon manager — grid view with per-element "Generate" via Recraft AI

CLI (pnpm --filter studio cli <command>)

  • gaps — full gap analysis report (missing translations, icons, sparse categories, validation errors)
  • validate — taxonomy consistency checks
  • translate -t <locale> — bulk translate via Claude API
  • icons --missing | --generate <id> — icon management via Recraft API

Architecture

  • lib/ — pure business logic shared between server API routes and CLI
  • ContentProvider interface for future extensibility (GitHub API, SQLite)
  • server/api/ — 11 Nitro API endpoints (CRUD elements, categories, gaps, translate, icons, git)

Test plan

  • Run pnpm dev:studio and browse to http://localhost:3001
  • Dashboard shows correct counts (149 elements, 19 categories, 6 locales)
  • Element browser lists and filters all elements
  • Run pnpm --filter studio cli gaps — verify report
  • Run pnpm --filter studio cli validate — should pass

🤖 Generated with Claude Code

pichot and others added 2 commits March 3, 2026 16:12
Nuxt 4 + Nuxt UI v4 web app and CLI for browsing, editing, translating,
and generating icons for the DTPR taxonomy. Reads/writes markdown files
in app/content/dtpr.v1/ directly via a ContentProvider interface designed
for future GitHub API integration.

Features:
- Dashboard with stats, gap analysis, and translation coverage
- Element browser with filtering by category, type, search, icon status
- Element editor with multi-locale tabs and save
- Category browser grouped by datachain type
- Translation matrix with bulk Claude AI translate
- Icon grid with Recraft AI SVG generation
- CLI tools: gaps, validate, translate, icons
- Git status and commit endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 3, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
dtpr-docs 0a133fb Mar 04 2026, 10:00 AM

@greptile-apps
Copy link

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR adds DTPR Studio, a comprehensive taxonomy management tool with web UI, CLI, and AI integrations for the DTPR project. The implementation introduces a well-architected system with shared business logic between the web app and CLI tools.

Key additions:

  • Complete Nuxt 4 SPA with dashboard, element/category browsers, translation manager, and icon manager
  • CLI tools for gap analysis, validation, translation, and icon generation
  • Claude API integration for automated translations across 6 locales
  • Recraft AI integration for SVG icon generation
  • Git workflow integration for committing changes
  • ContentProvider interface designed for future extensibility (GitHub API, etc.)

Issues found:

  • Critical bug: studio/lib/gap-analyzer.ts:85 hardcodes 'elements' collection query, breaking gap detection for categories and datachain_types
  • Timestamp format loses time precision (hardcoded to midnight UTC)
  • Git commit endpoint lacks authentication/authorization

The architecture is clean with proper separation of concerns (lib/ for pure logic, server/api/ for routes, cli/ for commands). The PR is production-ready after fixing the gap analyzer bug.

Confidence Score: 3/5

  • Safe to merge after fixing the critical gap analyzer bug
  • Score reflects one critical bug that breaks gap detection for categories/datachain_types, plus minor timestamp precision and auth considerations. The core architecture is solid, but the gap analyzer bug must be fixed before merging.
  • studio/lib/gap-analyzer.ts requires immediate attention (line 85 bug)

Important Files Changed

Filename Overview
studio/lib/gap-analyzer.ts Gap analysis logic with bug at line 85 (always queries 'elements' collection)
studio/lib/types.ts Type definitions for taxonomy data structures and interfaces
studio/lib/content-reader.ts LocalContentProvider implementation for reading markdown files
studio/lib/claude-translator.ts Claude API integration for translating taxonomy elements
studio/server/api/git/commit.post.ts Git commit endpoint with no authentication or validation
studio/server/api/elements/[id].put.ts Element update endpoint that modifies markdown frontmatter
studio/server/utils/git.ts Git utility functions using simple-git library
studio/cli/commands/translate.ts CLI command for bulk translation with Claude AI

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Studio Web UI<br/>Nuxt 4 SPA<br/>Port 3001] --> B[Nitro API Routes<br/>11 endpoints]
    C[Studio CLI<br/>Commander] --> D[Shared Business Logic<br/>lib/]
    B --> D
    D --> E[LocalContentProvider<br/>content-reader.ts]
    D --> F[Gap Analyzer<br/>gap-analyzer.ts]
    D --> G[Claude Translator<br/>claude-translator.ts]
    D --> H[Recraft Generator<br/>recraft-generator.ts]
    E --> I[(Markdown Files<br/>app/content/dtpr.v1/)]
    E --> J[(SVG Icons<br/>app/public/dtpr-icons/)]
    G --> K[Anthropic API<br/>Claude Sonnet]
    H --> L[Recraft AI API<br/>Icon Generation]
    B --> M[Git Utils<br/>simple-git]
    M --> N[Git Repository<br/>Commits]
    D --> O[Content Writer<br/>content-writer.ts]
    O --> I
    O --> J
Loading

Last reviewed commit: 247a493

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

45 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

}
if (missingLocales.length > 0) {
// Get the id from the English file
const parsed = await provider.query('elements' as Collection, { locale: 'en' })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded to query 'elements' collection, but should use the collection variable from the loop (line 69). This breaks gap detection for categories and datachain_types.

Suggested change
const parsed = await provider.query('elements' as Collection, { locale: 'en' })
const parsed = await provider.query(collection, { locale: 'en' })
Prompt To Fix With AI
This is a comment left during a code review.
Path: studio/lib/gap-analyzer.ts
Line: 85

Comment:
Hardcoded to query `'elements'` collection, but should use the `collection` variable from the loop (line 69). This breaks gap detection for categories and datachain_types.

```suggestion
        const parsed = await provider.query(collection, { locale: 'en' })
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +1 to +12
import { gitCommit } from '~/server/utils/git'

export default defineEventHandler(async (event) => {
const body = await readBody(event)
const { message, files } = body

if (!message) {
throw createError({ statusCode: 400, message: 'Commit message is required' })
}

return gitCommit(message, files)
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding authentication/authorization - currently anyone with API access can commit to the repository.

Prompt To Fix With AI
This is a comment left during a code review.
Path: studio/server/api/git/commit.post.ts
Line: 1-12

Comment:
Consider adding authentication/authorization - currently anyone with API access can commit to the repository.

How can I resolve this? If you propose a fix, please make it concise.

// Update translatable fields
if (name !== undefined) currentFrontmatter.name = name
if (description !== undefined) currentFrontmatter.description = description
currentFrontmatter.updated_at = new Date().toISOString().split('T')[0] + 'T00:00:00Z'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded T00:00:00Z loses time precision - all updates appear to happen at midnight UTC. Consider using full ISO timestamp.

Prompt To Fix With AI
This is a comment left during a code review.
Path: studio/server/api/elements/[id].put.ts
Line: 53

Comment:
Hardcoded `T00:00:00Z` loses time precision - all updates appear to happen at midnight UTC. Consider using full ISO timestamp.

How can I resolve this? If you propose a fix, please make it concise.

Extract icon generation into modular layers: recraft-config (prompts/models),
icon-shapes (category→shape mapping with SVG templates), and icon-compositor
(compositing inner icons into shaped containers). Add light/dark/colored
variants, shape override support, and save endpoint. Replace single icons
page with index + generate views. Use useIconUrl composable for icon paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant