Skip to content

The one and only agent harness for complex codebases. Project memory, planning, execution, and verified completion inside Codex.

feat(docs): add markdown docs shell and /docs route

YeonGyu-Kimaaf5acdcd5d7
diff --git a/packages/web/app/docs/page.tsx b/packages/web/app/docs/page.tsx
new file mode 100644
index 00000000..3acc83f1
--- /dev/null
+++ b/packages/web/app/docs/page.tsx
@@ -0,0 +1,55 @@
+import { DOC_SECTIONS } from "@/lib/docs-sections";
+import { loadDocSource } from "@/lib/docs-source";
+import { SiteHeader } from "@/components/site/site-header";
+import { SiteFooter } from "@/components/site/site-footer";
+import { DocsShell } from "@/components/docs/docs-shell";
+import type { Metadata } from "next";
+import "@/app/styles/docs.css";
+
+export const metadata: Metadata = {
+ title: "Documentation",
+ description: "LazyCodex documentation — install, ultrawork mode, $ulw-loop, $ulw-plan, $start-work.",
+ alternates: {
+ canonical: "/docs",
+ },
+};
+
+export default function DocsPage() {
+ const sections = DOC_SECTIONS.map((s) => ({ id: s.id, title: s.title }));
+
+ return (
+ <>
+ <a href="#content" className="skip-link">
+ Skip to main content
+ </a>
+ <SiteHeader />
+ <main id="content" className="docs-page">
+ <div className="docs-hero">
+ <h1 className="docs-hero-title">Documentation</h1>
+ <p className="docs-hero-tagline">
+ Learn how to install, configure, and use LazyCodex for ultrawork.
+ </p>
+ </div>
+ <DocsShell sections={sections}>
+ {DOC_SECTIONS.map((s) => (
+ <section
+ key={s.id}
+ id={s.id}
+ aria-labelledby={`${s.id}-title`}
+ className="docs-section"
+ >
+ <h2 id={`${s.id}-title`} className="docs-section-title">
+ {s.title}
+ </h2>
+ <article
+ className="docs-content"
+ dangerouslySetInnerHTML={{ __html: loadDocSource(s.file) }}
+ />
+ </section>
+ ))}
+ </DocsShell>
+ </main>
+ <SiteFooter />
+ </>
+ );
+}
diff --git a/packages/web/app/styles/docs.css b/packages/web/app/styles/docs.css
new file mode 100644
index 00000000..a04de896
--- /dev/null
+++ b/packages/web/app/styles/docs.css
@@ -0,0 +1,226 @@
+.skip-link {
+ position: absolute;
+ top: -40px;
+ left: 0;
+ background: var(--accent-cyan);
+ color: var(--surface-base);
+ padding: 8px;
+ z-index: 100;
+ transition: top 0.2s;
+}
+
+.skip-link:focus {
+ top: 0;
+}
+
+.docs-page {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 2rem 1rem;
+}
+
+.docs-hero {
+ margin-bottom: 3rem;
+ text-align: center;
+}
+
+.docs-hero-title {
+ font-size: 3rem;
+ font-weight: 700;
+ color: var(--text-primary);
+ margin-bottom: 1rem;
+}
+
+.docs-hero-tagline {
+ font-size: 1.25rem;
+ color: var(--text-secondary);
+}
+
+.docs-layout {
+ display: flex;
+ gap: 3rem;
+ position: relative;
+}
+
+.docs-mobile-toggle {
+ display: none;
+ width: 100%;
+ padding: 1rem;
+ background: var(--card-base);
+ color: var(--text-primary);
+ border: 1px solid var(--border-subtle);
+ border-radius: 8px;
+ margin-bottom: 1rem;
+ cursor: pointer;
+}
+
+.docs-sidebar {
+ width: 250px;
+ flex-shrink: 0;
+ position: sticky;
+ top: 2rem;
+ height: calc(100vh - 4rem);
+ overflow-y: auto;
+}
+
+.docs-search {
+ margin-bottom: 1.5rem;
+}
+
+.docs-search-input {
+ width: 100%;
+ padding: 0.75rem;
+ background: var(--card-base);
+ border: 1px solid var(--border-subtle);
+ border-radius: 6px;
+ color: var(--text-primary);
+}
+
+.docs-search-input:focus {
+ outline: 2px solid var(--accent-cyan);
+ outline-offset: -1px;
+}
+
+.docs-nav-list {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.docs-nav-item {
+ margin-bottom: 0.5rem;
+}
+
+.docs-nav-link {
+ display: block;
+ padding: 0.5rem;
+ color: var(--text-secondary);
+ text-decoration: none;
+ border-radius: 4px;
+ transition: color 0.2s, background 0.2s;
+}
+
+.docs-nav-link:hover {
+ color: var(--text-primary);
+ background: var(--card-base);
+}
+
+.docs-nav-link.active {
+ color: var(--accent-cyan);
+ font-weight: 600;
+}
+
+.docs-main-content {
+ flex-grow: 1;
+ min-width: 0;
+}
+
+.docs-section {
+ margin-bottom: 4rem;
+}
+
+.docs-section-title {
+ font-size: 2rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ margin-bottom: 1.5rem;
+ padding-top: 2rem;
+ scroll-margin-top: 2rem;
+}
+
+.docs-content {
+ color: var(--text-secondary);
+ line-height: 1.6;
+}
+
+.docs-content h3 {
+ font-size: 1.5rem;
+ color: var(--text-primary);
+ margin: 2rem 0 1rem;
+}
+
+.docs-content p {
+ margin-bottom: 1rem;
+}
+
+.docs-content ul,
+.docs-content ol {
+ margin-bottom: 1rem;
+ padding-left: 1.5rem;
+}
+
+.docs-content li {
+ margin-bottom: 0.5rem;
+}
+
+.docs-content a {
+ color: var(--accent-cyan);
+ text-decoration: underline;
+ text-decoration-color: transparent;
+ transition: text-decoration-color 0.2s;
+}
+
+.docs-content a:hover {
+ text-decoration-color: var(--accent-cyan);
+}
+
+.docs-content code {
+ font-family: monospace;
+ background: var(--card-base);
+ padding: 0.2em 0.4em;
+ border-radius: 4px;
+ font-size: 0.9em;
+}
+
+.docs-content pre {
+ background: #0E1115;
+ padding: 1.5rem;
+ border-radius: 8px;
+ overflow-x: auto;
+ margin-bottom: 1.5rem;
+}
+
+.docs-content pre code {
+ background: transparent;
+ padding: 0;
+ color: #e2e8f0;
+}
+
+.docs-content blockquote {
+ border-left: 4px solid var(--accent-cyan);
+ padding-left: 1rem;
+ margin: 1.5rem 0;
+ color: var(--text-primary);
+ background: var(--card-base);
+ padding: 1rem;
+ border-radius: 0 8px 8px 0;
+}
+
+@media (max-width: 768px) {
+ .docs-layout {
+ flex-direction: column;
+ gap: 1rem;
+ }
+
+ .docs-mobile-toggle {
+ display: block;
+ }
+
+ .docs-sidebar {
+ display: none;
+ width: 100%;
+ height: auto;
+ position: static;
+ }
+
+ .docs-sidebar.open {
+ display: block;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .docs-nav-link,
+ .docs-content a {
+ transition: none;
+ }
+}
diff --git a/packages/web/components/docs/docs-shell.tsx b/packages/web/components/docs/docs-shell.tsx
new file mode 100644
index 00000000..c1a4bb5d
--- /dev/null
+++ b/packages/web/components/docs/docs-shell.tsx
@@ -0,0 +1,113 @@
+"use client";
+
+import { useState, useEffect, useRef } from "react";
+
+interface Section {
+ id: string;
+ title: string;
+}
+
+interface DocsShellProps {
+ sections: ReadonlyArray<Section>;
+ children: React.ReactNode;
+}
+
+export function DocsShell({ sections, children }: DocsShellProps) {
+ const [searchQuery, setSearchQuery] = useState("");
+ const [activeId, setActiveId] = useState<string>("");
+ const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
+ const observerRef = useRef<IntersectionObserver | null>(null);
+
+ const filteredSections = sections.filter((s) =>
+ s.title.toLowerCase().includes(searchQuery.toLowerCase())
+ );
+
+ useEffect(() => {
+ const handleHashChange = () => {
+ const hash = window.location.hash.slice(1);
+ if (hash) {
+ setActiveId(hash);
+ }
+ };
+
+ window.addEventListener("hashchange", handleHashChange);
+ handleHashChange();
+
+ return () => window.removeEventListener("hashchange", handleHashChange);
+ }, []);
+
+ useEffect(() => {
+ observerRef.current = new IntersectionObserver(
+ (entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) {
+ setActiveId(entry.target.id);
+ }
+ }
+ },
+ { rootMargin: "-20% 0px -80% 0px" }
+ );
+
+ const sectionElements = document.querySelectorAll(".docs-section h2[id]");
+ for (const el of sectionElements) {
+ observerRef.current.observe(el);
+ }
+
+ return () => {
+ if (observerRef.current) {
+ observerRef.current.disconnect();
+ }
+ };
+ }, [sections]);
+
+ return (
+ <div className="docs-layout">
+ <button
+ type="button"
+ className="docs-mobile-toggle"
+ onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
+ aria-expanded={isMobileMenuOpen}
+ aria-controls="docs-sidebar"
+ >
+ {isMobileMenuOpen ? "Close Menu" : "Menu"}
+ </button>
+
+ <aside
+ id="docs-sidebar"
+ className={`docs-sidebar ${isMobileMenuOpen ? "open" : ""}`}
+ >
+ <div className="docs-search">
+ <label htmlFor="docs-search-input" className="sr-only">
+ Search documentation
+ </label>
+ <input
+ id="docs-search-input"
+ type="search"
+ placeholder="Search..."
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ className="docs-search-input"
+ />
+ </div>
+ <nav aria-label="Documentation" className="docs-nav">
+ <ul className="docs-nav-list">
+ {filteredSections.map((s) => (
+ <li key={s.id} className="docs-nav-item">
+ <a
+ href={`#${s.id}`}
+ className={`docs-nav-link ${activeId === s.id ? "active" : ""}`}
+ aria-current={activeId === s.id ? "location" : undefined}
+ onClick={() => setIsMobileMenuOpen(false)}
+ >
+ {s.title}
+ </a>
+ </li>
+ ))}
+ </ul>
+ </nav>
+ </aside>
+
+ <div className="docs-main-content">{children}</div>
+ </div>
+ );
+}