# 1toe/workprd architecture

> Architecture diagram of the GitHub repository 1toe/workprd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/1toe/workprd
- Repository: https://github.com/1toe/workprd

## Overview

#### Purpose and entry points
This repository presents a Spanish-language prompt/workflow library centered on PRD creation, changes, verification, feature extraction, RFCs, rules, and implementation prompts. The primary application is a Next.js App Router site entered through `src/app/page.tsx`, with route-specific prompt and view pages.

#### Application routing
- Root landing page: `src/app/page.tsx`
- Dynamic prompt detail route: `src/app/p/[id]/page.tsx`
- Dynamic view route: `src/app/views/[id]/page.tsx`
- Prompt catalog route: `src/app/views/prompts-index/page.tsx`

The `[id]` segments are the principal navigation boundary: route parameters select individual prompt or view content rather than requiring a separate page implementation per prompt.

#### Prompt-content layer
Prompt definitions/content are centralized in `src/constants/contenidoPrompts.ts`, while source Markdown prompt artifacts live under `mds/`, including:
- `mds/interactive-prd-creation-prompt.md`
- `mds/prd-to-rfcs-prompt.md`
- `mds/implementation-prompt-template.md`

This creates a content boundary between reusable prompt material and the UI that indexes or renders it. Legacy standalone HTML prompt pages remain in `views/`, such as `views/prompts-index.html` and `views/interactive.html`.

#### UI composition
Reusable presentation components are organized in `src/components/ui/`. The main site is composed from navigation, hero/section, prompt-card, prompt-viewer, modal, footer, and workflow-step components:
- `src/components/ui/Navegacion.tsx`
- `src/components/ui/TarjetaPrompt.tsx`
- `src/components/ui/VisualizadorPrompt.tsx`

These components support a content-driven catalog/detail experience rather than embedding each prompt’s UI directly in routes.

#### Theme and client interaction
Theme state is isolated in React context and a hook:
- `src/context/TemaContexto.tsx`
- `src/hooks/useTheme.ts`
- `src/components/ui/BotonTema.tsx`

Interactive UI elements, including prompt viewing and modal behavior, are represented by `src/components/ui/Modal.tsx` and `src/components/ui/VisualizadorPrompt.tsx`. Global styling begins at `src/app/globals.css`; the repository also retains non-App-Router CSS under `css/`.

#### Runtime and deployment boundaries
The active application is configured as a Next.js/TypeScript project through `next.config.js`, `next.config.mjs`, and `tsconfig.json`, with Tailwind/PostCSS configuration in `tailwind.config.ts` and `postcss.config.js`. Deployment targeting is indicated by `vercel.json`.

`capacitor.config.ts` and `ionic.config.json` indicate an optional mobile-wrapper/runtime boundary. No backend, database, authentication provider, or external API integration is evidenced by the supplied tree.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Next.js web app"]
  node_landing["Landing page<br/>App Router route<br/>[page.tsx]"]
  node_prompt_route["Prompt detail route<br/>dynamic route<br/>[page.tsx]"]
  node_view_route["View route<br/>dynamic route<br/>[page.tsx]"]
  node_catalog_route["Prompt catalog<br/>App Router route<br/>[page.tsx]"]
  node_global_styles["Global styles<br/>CSS<br/>[globals.css]"]
end

subgraph group_content["Prompt content"]
  node_prompt_registry["Prompt registry<br/>content definitions"]
  node_prd_markdown["PRD creation prompt<br/>Markdown artifact"]
  node_rfc_markdown["PRD-to-RFC prompt<br/>Markdown artifact"]
  node_implementation_markdown["Implementation prompt<br/>Markdown artifact"]
  node_legacy_views["Legacy HTML views<br/>static HTML<br/>[prompts-index.html]"]
end

subgraph group_ui["UI and interaction"]
  node_ui_components["Reusable UI components<br/>component library<br/>[Navegacion.tsx]"]
  node_prompt_card["Prompt card<br/>UI component<br/>[TarjetaPrompt.tsx]"]
  node_prompt_viewer["Prompt viewer<br/>interactive UI component"]
  node_modal["Modal<br/>interactive UI component<br/>[Modal.tsx]"]
  node_theme["Theme state<br/>React context<br/>[TemaContexto.tsx]"]
  node_theme_toggle["Theme toggle<br/>UI component<br/>[BotonTema.tsx]"]
end

subgraph group_runtime["Runtime targets"]
  node_next_runtime{{"Next.js runtime<br/>application runtime<br/>[next.config.js]"}}
  node_vercel{{"Vercel deployment<br/>deployment target<br/>[vercel.json]"}}
  node_mobile_wrapper{{"Mobile wrapper<br/>optional runtime"}}
end

node_next_runtime -->|"serves"| node_landing
node_landing -->|"composes"| node_ui_components
node_catalog_route -->|"indexes"| node_prompt_registry
node_catalog_route -->|"renders"| node_prompt_card
node_prompt_route -->|"resolves by ID"| node_prompt_registry
node_view_route -->|"resolves by ID"| node_prompt_registry
node_prompt_route -->|"renders"| node_prompt_viewer
node_view_route -->|"renders"| node_prompt_viewer
node_prompt_viewer -->|"uses"| node_modal
node_prompt_registry -.->|"draws from"| node_prd_markdown
node_prompt_registry -.->|"draws from"| node_rfc_markdown
node_prompt_registry -.->|"draws from"| node_implementation_markdown
node_ui_components -->|"consumes"| node_theme
node_theme_toggle -->|"updates"| node_theme
node_next_runtime -->|"loads"| node_global_styles
node_vercel -->|"deploys"| node_next_runtime
node_mobile_wrapper -.->|"wraps optionally"| node_next_runtime
node_legacy_views -.->|"legacy counterpart"| node_catalog_route

click node_landing "https://github.com/1toe/workprd/blob/main/src/app/page.tsx"
click node_prompt_route "https://github.com/1toe/workprd/blob/main/src/app/p/%5Bid%5D/page.tsx"
click node_view_route "https://github.com/1toe/workprd/blob/main/src/app/views/%5Bid%5D/page.tsx"
click node_catalog_route "https://github.com/1toe/workprd/blob/main/src/app/views/prompts-index/page.tsx"
click node_prompt_registry "https://github.com/1toe/workprd/blob/main/src/constants/contenidoPrompts.ts"
click node_prd_markdown "https://github.com/1toe/workprd/blob/main/mds/interactive-prd-creation-prompt.md"
click node_rfc_markdown "https://github.com/1toe/workprd/blob/main/mds/prd-to-rfcs-prompt.md"
click node_implementation_markdown "https://github.com/1toe/workprd/blob/main/mds/implementation-prompt-template.md"
click node_legacy_views "https://github.com/1toe/workprd/blob/main/views/prompts-index.html"
click node_ui_components "https://github.com/1toe/workprd/blob/main/src/components/ui/Navegacion.tsx"
click node_prompt_card "https://github.com/1toe/workprd/blob/main/src/components/ui/TarjetaPrompt.tsx"
click node_prompt_viewer "https://github.com/1toe/workprd/blob/main/src/components/ui/VisualizadorPrompt.tsx"
click node_modal "https://github.com/1toe/workprd/blob/main/src/components/ui/Modal.tsx"
click node_theme "https://github.com/1toe/workprd/blob/main/src/context/TemaContexto.tsx"
click node_theme_toggle "https://github.com/1toe/workprd/blob/main/src/components/ui/BotonTema.tsx"
click node_global_styles "https://github.com/1toe/workprd/blob/main/src/app/globals.css"
click node_next_runtime "https://github.com/1toe/workprd/blob/main/next.config.js"
click node_vercel "https://github.com/1toe/workprd/blob/main/vercel.json"
click node_mobile_wrapper "https://github.com/1toe/workprd/blob/main/capacitor.config.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_landing,node_prompt_route,node_view_route,node_catalog_route,node_global_styles toneBlue
class node_prompt_registry,node_prd_markdown,node_rfc_markdown,node_implementation_markdown,node_legacy_views toneAmber
class node_ui_components,node_prompt_card,node_prompt_viewer,node_modal,node_theme,node_theme_toggle toneMint
class node_next_runtime,node_vercel,node_mobile_wrapper toneRose
```

## Components

### Next.js web app

- [Landing page](https://github.com/1toe/workprd/blob/main/src/app/page.tsx): App Router route · Primary site entry point. · `src/app/page.tsx`
- [Prompt detail route](https://github.com/1toe/workprd/blob/main/src/app/p/%5Bid%5D/page.tsx): dynamic route · Selects a prompt by ID. · `src/app/p/[id]/page.tsx`
- [View route](https://github.com/1toe/workprd/blob/main/src/app/views/%5Bid%5D/page.tsx): dynamic route · Selects a view by ID. · `src/app/views/[id]/page.tsx`
- [Prompt catalog](https://github.com/1toe/workprd/blob/main/src/app/views/prompts-index/page.tsx): App Router route · `src/app/views/prompts-index/page.tsx`
- [Global styles](https://github.com/1toe/workprd/blob/main/src/app/globals.css): CSS · `src/app/globals.css`

### Prompt content

- [Prompt registry](https://github.com/1toe/workprd/blob/main/src/constants/contenidoPrompts.ts): content definitions · Centralized prompt definitions for the UI. · `src/constants/contenidoPrompts.ts`
- [PRD creation prompt](https://github.com/1toe/workprd/blob/main/mds/interactive-prd-creation-prompt.md): Markdown artifact · `mds/interactive-prd-creation-prompt.md`
- [PRD-to-RFC prompt](https://github.com/1toe/workprd/blob/main/mds/prd-to-rfcs-prompt.md): Markdown artifact · `mds/prd-to-rfcs-prompt.md`
- [Implementation prompt](https://github.com/1toe/workprd/blob/main/mds/implementation-prompt-template.md): Markdown artifact · `mds/implementation-prompt-template.md`
- [Legacy HTML views](https://github.com/1toe/workprd/blob/main/views/prompts-index.html): static HTML · Retained standalone prompt pages. · `views/prompts-index.html`

### UI and interaction

- [Reusable UI components](https://github.com/1toe/workprd/blob/main/src/components/ui/Navegacion.tsx): component library · Navigation, cards, sections, footer, and workflow presentation. · `src/components/ui/Navegacion.tsx`
- [Prompt card](https://github.com/1toe/workprd/blob/main/src/components/ui/TarjetaPrompt.tsx): UI component · `src/components/ui/TarjetaPrompt.tsx`
- [Prompt viewer](https://github.com/1toe/workprd/blob/main/src/components/ui/VisualizadorPrompt.tsx): interactive UI component · Renders prompt content and viewing interactions. · `src/components/ui/VisualizadorPrompt.tsx`
- [Modal](https://github.com/1toe/workprd/blob/main/src/components/ui/Modal.tsx): interactive UI component · `src/components/ui/Modal.tsx`
- [Theme state](https://github.com/1toe/workprd/blob/main/src/context/TemaContexto.tsx): React context · Shared theme state and hook. · `src/context/TemaContexto.tsx`
- [Theme toggle](https://github.com/1toe/workprd/blob/main/src/components/ui/BotonTema.tsx): UI component · `src/components/ui/BotonTema.tsx`

### Runtime targets

- [Next.js runtime](https://github.com/1toe/workprd/blob/main/next.config.js): application runtime · TypeScript App Router application configuration. · `next.config.js`
- [Vercel deployment](https://github.com/1toe/workprd/blob/main/vercel.json): deployment target · `vercel.json`
- [Mobile wrapper](https://github.com/1toe/workprd/blob/main/capacitor.config.ts): optional runtime · Capacitor/Ionic mobile packaging boundary. · `capacitor.config.ts`

## Connections

- Next.js runtime → Landing page: serves
- Landing page → Reusable UI components: composes
- Prompt catalog → Prompt registry: indexes
- Prompt catalog → Prompt card: renders
- Prompt detail route → Prompt registry: resolves by ID
- View route → Prompt registry: resolves by ID
- Prompt detail route → Prompt viewer: renders
- View route → Prompt viewer: renders
- Prompt viewer → Modal: uses
- Prompt registry → PRD creation prompt: draws from
- Prompt registry → PRD-to-RFC prompt: draws from
- Prompt registry → Implementation prompt: draws from
- Reusable UI components → Theme state: consumes
- Theme toggle → Theme state: updates
- Next.js runtime → Global styles: loads
- Vercel deployment → Next.js runtime: deploys
- Mobile wrapper → Next.js runtime: wraps optionally
- Legacy HTML views → Prompt catalog: legacy counterpart
