You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Record the investigation and writing process for the Project Creation Guideline reference document, which describes the full-stack project patterns used across go-go-golems/TTC repos.
Step 1: Repository Discovery and Evidence Gathering
I surveyed three repositories to extract the common project creation patterns: the current TTC design-system repo, the Pyxis venue management repo, and the go-template scaffold repo. The goal was to gather concrete evidence for every claim in the guideline document.
Prompt Context
User prompt (verbatim): "Create a new docmgr ticket for creating a project creation guideline reference document. First, we analyze the current structure and similar repos like /home/manuel/code/wesen/2026-04-23--pyxis Analyze the current repository and document the guidelines for the react setup: storybook, react, redux, rtk-query for the go: glazed verbs, go-template setup from ~/code/wesen/go-go-golems/go-template"
Assistant interpretation: Create a docmgr ticket and write an exhaustive intern-ready guideline document covering the full-stack patterns (React/Storybook/Redux/RTK Query on the frontend, Glazed verbs/go-template on the backend) by analyzing the TTC design system repo and the Pyxis repo as evidence.
Inferred user intent: Produce a reusable reference that a new intern can follow to create a new project in the same style, with enough technical depth and file references that they don't need to guess.
What I did
Created docmgr ticket PROJ-GUIDE-001 with two documents (design doc + diary)
Read Go entry points: pyxis/cmd/pyxis/main.go, pyxis/cmd/pyxis/cmds/serve.go, ttc-garden-chat/main.go
Read the glazed verb pattern from the serve command (ServeCommand with CommandDescription, fields, sections, RunIntoGlazeProcessor)
Read the go-template scaffold (cmd/XXX/main.go, pkg/logcopter.go, logcopter_generate.go)
Read the dmeta component manifest system from TTC
Why
Need evidence-backed claims for every pattern documented in the guideline.
What worked
Finding the consistent pnpm monorepo pattern across TTC and Pyxis
Identifying the glazed verb pattern as the standard Go command abstraction
Discovering that go-template provides the scaffold with logcopter, goreleaser, CI, and lefthook
Confirming RTK Query usage in Pyxis and Redux Toolkit setup in TTC
What didn't work
N/A (discovery phase, no failures)
What I learned
The go-template repo uses XXX as a placeholder name that must be replaced everywhere
The glazed verb pattern is consistent: define a struct with CommandDescription, add fields/sections, implement RunIntoGlazeProcessor or RunIntoWriter
Both Pyxis and TTC use makeStore() factory pattern for Redux stores
The dmeta system in TTC is a design-metadata-driven code generation pipeline for React components
What was tricky to build
Understanding the exact boundary between generated (dmeta) components and hand-written promoted components requires reading both the generated manifest and the promotion state
What warrants a second pair of eyes
The glazed verb lifecycle: whether RunIntoGlazeProcessor vs RunIntoWriter is the right choice for new commands
The go-template replacement strategy: all XXX strings must be replaced, but some are in CI secrets/tokens that can't be found by simple grep
What should be done in the future
Cross-reference the glazed help system documentation for the help export command
Document the devctl plugin protocol in more detail
Fixed the glazed vocabulary entry (it wasn't persisted in the YAML initially, re-added). Removed cross-repo related files from the ticket index (Pyxis and go-template files are outside this repo, so doctor reported them as missing). Doctor passes cleanly after fixes.
Uploaded the design doc + diary bundle to reMarkable at /ai/2026/06/03/PROJ-GUIDE-001. Dry-run confirmed the correct file list and output name. Upload succeeded and was verified via remarquee cloud ls.
Prompt Context
User prompt (verbatim): (see Step 1)
Assistant interpretation: Commit work and upload to reMarkable.
Inferred user intent: Persist the work to git and deliver to reMarkable for reading.
What I did
Added glazed vocab entry (again, first attempt didn't persist)
Removed cross-repo related file entries from ticket index
This document is the reference guide for creating new full-stack projects in the go-go-golems ecosystem. It describes the two major halves of any project — the React/TypeScript frontend and the Go backend — and the standard tooling, file layout, and patterns that connect them. Every pattern here is backed by concrete evidence from two production projects: the TTC Garden Assistant (2026-05-27--ttc-design-system) and Pyxis (2026-04-23--pyxis), plus the go-template scaffold (go-go-golems/go-template).
A new intern should be able to read this document, copy the go-template scaffold, set up the pnpm workspace, wire the glazed verb, configure Storybook, and have a running full-stack project by the end of the day.
Problem Statement and Scope
New projects in this ecosystem follow a specific stack and set of conventions, but these conventions are distributed across multiple repositories, READMEs, and AGENT.md files. There is no single document that walks through the full project creation process end-to-end, from go-template scaffold to running Storybook and backend.
This guideline covers:
Go backend scaffolding from go-template, including CI, linting, release, and the Glazed verb command pattern.
React frontend setup with pnpm monorepo, Vite, Storybook, Redux Toolkit, and RTK Query.
Design system architecture with the atomic design layer stack (tokens → foundation → atoms → molecules → organisms → pages).
Full-stack integration patterns: Go serving the embedded SPA, WebSocket chat, and devctl-based development workflow.
Dmeta code generation pipeline for design-metadata-driven component scaffolding.
Part I: Go Backend — The go-template Scaffold
1.1 Overview
Every new Go project starts from the go-template repository at ~/code/wesen/go-go-golems/go-template. This is a minimal scaffold that ships with:
A placeholder binary entry point at cmd/XXX/main.go
Package scaffolding at pkg/doc.go and pkg/logcopter.go
A go:generate directive for structured logging via logcopter
A Makefile with standard targets (lint, test, build, goreleaser)
GitHub Actions CI (push, release, lint, security scanning)
GoReleaser configuration for cross-platform builds, Homebrew tap, and Fury.io deb/rpm publishing
The template uses XXX as a placeholder for the binary/module name. You must replace every occurrence:
# Replace in all tracked files (be careful with .git/ and binary files)
grep -r "XXX" --include='*.go' --include='*.yaml' --include='*.yml' --include='*.md' -l .# Then manually edit each file to replace XXX with your project name
Generated logger (pkg/logcopter.go — DO NOT EDIT):
// Code generated by logcopter-gen; DO NOT EDIT.package pkg
import logcopter "github.com/go-go-golems/logcopter/pkg/logcopter"varlog=logcopter.Package("go-go-golems.XXX.pkg")
CI verification: The push workflow runs make logcopter-check to ensure generated loggers are up to date, and git diff --exit-code to verify no stale generated files.
The logcopter system creates a hierarchical logger per package. The -area-prefix flag sets the top-level area (e.g., go-go-golems.pyxis), and -strip-prefix removes the module path from package names, resulting in structured log fields like area=pyxis.pkg.db or area=pyxis.pkg.server.
1.5 The Makefile
The go-template Makefile provides these standard targets:
Target
Purpose
lint
Run golangci-lint
lintmax
Run golangci-lint with higher issue limit
test
Run go test ./...
build
go generate + go build
logcopter-generate
Regenerate logcopter loggers
logcopter-check
Verify logcopter loggers are up to date
goreleaser
Run GoReleaser (snapshot by default)
tag-major/minor/patch
Bump semver tags using svu
release
Push tags + publish to Go proxy
bump-go-go-golems
Update all go-go-golems dependencies to latest
install
Build and copy binary to PATH
Key convention: GOWORK=off is used on all targets to avoid interference from Go workspace mode.
1.6 GoReleaser Configuration
The .goreleaser.yaml is set up for:
Two build targets: Linux (amd64, arm64 with cross-compilers) and Darwin (amd64, arm64)
CGO_ENABLED=1: Required for SQLite (mattn/go-sqlite3) used in most projects
GPG signing: Signs checksums with the GO_GO_GOLEMS_SIGN_KEY
Homebrew tap: Publishes to go-go-golems/homebrew-go-go-go
Fury.io: Publishes deb/rpm packages
Split release: The release workflow runs goreleaser on Linux and macOS runners separately, then merges the artifacts
The release workflow (release.yaml) requires these GitHub secrets:
# lefthook.ymlpre-commit:
commands:
lint:
glob: '*.go'run: make linttest:
glob: '*.go'run: make testparallel: truepre-push:
commands:
release:
run: make goreleaserlint:
run: make linttest:
run: make testparallel: true
This ensures that every commit passes lint and tests, and every push verifies a clean release build.
Exclusions: Specific staticcheck deprecation warnings for legacy glazed APIs
Part II: Go Backend — The Glazed Verb Pattern
2.1 Overview
The Glazed framework is the command abstraction layer used across all go-go-golems CLI applications. It provides a declarative way to define commands with typed flags, argument parsing, output formatting, and help system integration. Every CLI command in these projects is a "Glazed verb."
The key packages are:
github.com/go-go-golems/glazed/pkg/cmds — Command descriptions and interfaces
github.com/go-go-golems/glazed/pkg/cmds/fields — Declarative flag definitions
github.com/go-go-golems/glazed/pkg/cmds/values — Parsed flag value access
Environment variable convention: Flags typically have corresponding environment variables with the project prefix (e.g., PYXIS_BIND, PYXIS_DATABASE_URL). The envOr() helper provides fallback:
Key convention: Use pnpm --filter <package-name> to run scripts in specific workspace packages. The --filter flag is the standard way to target a package.
The Vite configuration follows a standard pattern. Key aspects:
// vite.config.tsimport{defineConfig}from'vite';importreactfrom'@vitejs/plugin-react';exportdefaultdefineConfig({base: './',plugins: [react()],resolve: {dedupe: ['react','react-dom','react-redux'],// Prevent duplicate React},server: {host: '0.0.0.0',port: 3008,proxy: {// Proxy API requests to Go backend during development'/api/chat': {target: process.env.TTC_CHAT_BACKEND_TARGET??'http://localhost:8080',changeOrigin: true,ws: true,// WebSocket support},},},test: {environment: 'jsdom',setupFiles: './src/test/setup.ts',},});
Important: The dedupe option is critical for React — without it, pnpm workspace packages can end up with multiple React instances, causing hooks errors.
The autodocs: 'tag' setting auto-generates documentation for stories tagged with autodocs.
Part IV: React Frontend — Redux Toolkit and RTK Query
4.1 Store Configuration Pattern
Both projects use a makeStore() factory function. This is important for testing (each test gets a fresh store) and for Storybook (each story can have its own store).
Runtime/container wiring, side effects, chat overlay
5.2 The CSS Rules
From web/GUIDELINES.md:
Feature CSS may define:
Positioning
Grid/flex anatomy
Scroll regions
Responsive container sizing
Widget/message row placement
Feature CSS must NOT define:
One-off typography
Hard-coded colors
Ad-hoc shadows
Bespoke button styles
Product-card/widget internals (when foundation/atoms/organisms already provide those)
Rule: Use design tokens (--ttc-*) whenever CSS is unavoidable. Do not solve visual mismatches by adding large feature-specific CSS blocks. Prefer moving repeated visual decisions into the correct layer.
5.3 Component File Convention
Each component follows a consistent file structure:
For generated (dmeta) components, files are named ComponentName.generated.tsx, ComponentName.generated.module.css, ComponentName.generated.stories.tsx, etc.
5.4 The Dmeta Code Generation System
The TTC project uses a design-metadata-driven code generation pipeline called dmeta. This system generates React components from YAML metadata specifications.
The manifest (dmeta.generated-manifest.json) is a single JSON file listing all generated components with their template IDs, paths, semantics (domain types, representations, actions), and promotion status.
Promotion state is tracked in src/dmeta/promotionState.ts:
When a component is "promoted", it moves from src/generated/ to src/components/ and becomes hand-editable. The generated version is kept for reference but is no longer imported.
Part VI: Full-Stack Integration
6.1 Go Serving the Embedded SPA
Both Pyxis and TTC use Go's embed package to serve the built frontend from the Go binary. The pattern:
Create the application site package (pages, API, store)
Configure Vite with proxy to Go backend
Set up Redux store with makeStore() factory
Set up RTK Query API slice with endpoints and tagTypes
Run pnpm install && pnpm build && pnpm storybook
Phase 3: Integration
Add backend/scripts/build-web.sh to build and embed frontend
Add //go:generate bash ../../scripts/build-web.sh to main.go
Configure SPA fallback route in Go server
Test full-stack: devctl up → frontend connects to backend
Add WebSocket route if needed
Run visual regression tests with css-visual-diff
Phase 4: Dmeta Code Generation (optional, if design system needed)
Create dmeta-ir/ directory with YAML metadata specifications
Set up dmeta code generator (separate tool)
Run generator to produce src/generated/dmeta-widgets/
Configure componentManifest.ts and promotionState.ts
Promote components from generated to hand-written as needed
Add Storybook stories for generated and promoted components
Decision Records
Decision: pnpm workspace over Vite monorepo
Context: Need a monorepo structure for shared component library + app site.
Options considered: (1) pnpm workspaces, (2) Turborepo, (3) Nx, (4) Single Vite project with library mode.
Decision: pnpm workspaces with --filter targeting.
Rationale: Minimal configuration, native pnpm support, no additional build orchestration tool needed. Both existing projects use this pattern successfully.
Consequences: Must use pnpm --filter for all script execution. Workspace protocol dependencies (workspace:*) must be used for internal package references.
Status: accepted
Decision: Glazed verbs over raw Cobra commands
Context: Need structured command definitions with typed flags, composable settings, and output formatting.
Options considered: (1) Raw Cobra commands with manual flag parsing, (2) Glazed verb pattern, (3) Kong CLI framework.
Decision: Glazed verb pattern.
Rationale: All existing projects use Glazed. It provides declarative flag definitions, composable sections, automatic help generation, and structured output middleware. The Cobra bridge makes it compatible with the standard Go CLI ecosystem.
Consequences: New developers must learn the Glazed API (CommandDescription, fields.New, values.Values, sections). The dependency on glazed is significant.
Status: accepted
Decision: Redux Toolkit + RTK Query over React Query
Context: Need a data fetching and state management solution.
Decision: Redux Toolkit + RTK Query for Pyxis-style projects; Redux Toolkit (minimal) for TTC-style projects.
Rationale: RTK Query is integrated into Redux Toolkit, provides caching/invalidation/mutations out of the box, and the typed hook pattern works well. Pyxis uses this pattern successfully. TTC uses minimal Redux (empty reducer) because the chat architecture uses WebSocket-driven state rather than REST endpoints.
Consequences: RTK Query is optimal for REST APIs. For WebSocket-heavy apps, minimal Redux may suffice. Choose based on the data fetching pattern (REST vs WebSocket).
Status: accepted
Decision: net/http.ServeMux over third-party routers
Rationale: Go 1.22+ ServeMux supports method and path patterns (GET /api/v1/...). No third-party dependency needed. Consistent with AGENT.md guidelines.
Consequences: Must use Go 1.22+ pattern matching. Some advanced features (middleware chaining, route groups) require manual implementation.
Status: accepted
Risks and Open Questions
go-template freshness: The go-template may drift from actual project patterns as conventions evolve. Needs periodic syncing.
Dmeta documentation: The dmeta code generation pipeline is complex and not fully documented outside the TTC repo. A new project may not need it.
Pyxis uses TanStack Query in the component library but RTK Query in the user site: This mixed approach can be confusing. The guideline recommends standardizing on RTK Query for new projects.
Devctl plugin protocol: The .devctl.yaml plugin system uses NDJSON stdio protocol v2, which is documented in a separate skill. New projects need a Python or shell plugin.
CI secrets management: The release workflow requires 6+ GitHub secrets. New projects must set these up manually.