com um clique
designguidelines
Architectural and code-quality guidelines for cardano-graphical-tx
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Architectural and code-quality guidelines for cardano-graphical-tx
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Enforce mobile-first Tailwind CSS patterns, touch targets, layout rules, and testing checklists for all new pages and components in apps/web.
It's a grpc endpoint that returns information from cardano. There is a typescript sdk and a spec (with protobuf generated types).
| name | DesignGuidelines |
| description | Architectural and code-quality guidelines for cardano-graphical-tx |
| license | MIT |
These guidelines are aspirational. Legacy code may not follow them. Any new file, component, or provider method must adhere to them. When modifying legacy code, refactor it to comply if the change is non-trivial.
Components should be short and do one thing. Avoid nested conditional rendering that makes JSX hard to scan. If a component has more than ~100 lines or multiple useState hooks, split it.
Example: TxRow shows one transaction. BlockTxsAccordion shows one block. They don't mix concerns.
Reference: apps/web/app/_components/ExplorerSection/Transactions/TxRow.tsx
TxRow (~130 lines total) is already pushing the limit, but it delegates layout to two focused sub-components:
TxRowHeader — renders the hash, timestamp, fee, and action buttonsUTxOsColumn — renders inputs or outputs in a columnIf
TxRowalso handled pagination or block grouping, it would violate this rule.
Multi-step state logic, derived state, and side effects belong in custom hooks. Hooks should be co-located with the component or in app/_hooks/.
Examples:
useLocalStorage — syncs React state with localStorage via useState + useEffectuseNetwork — derives devnetPort, config, addressPrefix, and provider availability via useMemoReferences:
A component that mixes pagination state, form validation, and canvas coordinate math should extract each concern into its own hook.
All provider-related types belong in packages/provider-core/src/index.ts. Never duplicate Tx, UTxO, BlockMetadata, etc. in app or provider packages. UI-specific types can live next to the component if they're not reusable.
Reference: packages/provider-core/src/index.ts
BlockMetadata, PaginatedRequest, PaginatedResult, ChainProvider, and all request/response shapes are defined once hereTxRow.tsx imports cardano.Tx from @laceanatomy/types — it does not redefine its own transaction shapeBase URLs, API keys, and node endpoints must never be hardcoded.
getNetworkConfigServer(chain)Reference: apps/web/server/api/dolos-provider.ts
const {
dolosBlockfrostUrl,
dolosBlockfrostApiKey,
dolosUtxorpcUrl,
dolosUtxorpcApiKey,
addressPrefix
} = getNetworkConfigServer(chain);
Notice that the Dolos provider does not contain a single literal URL or key. Everything is injected from the server config, which in turn reads from environment variables.
server/api/*) into client componentsSuspense and streaming for async server dataReference: apps/web/app/_components/GraphicalSection/InfoPanel/TxInfo.tsx
TxInfo is a client component ("use client") that uses Heroui Accordion, useDisclosure, and useState for interactivitydolos-provider.tsIf a component needs to fetch data, use a server component, a tRPC query, or a route handler — not a
useEffectinside a client component.
Card, Accordion, Button, etc.) for common UI primitivesbg-surface, text-p-secondary)References:
apps/web/app/_components/ExplorerSection/Transactions/TxRow.tsx — uses bg-explorer-row, text-accent-blue, border-borderapps/web/app/_components/GraphicalSection/InfoPanel/TxInfo.tsx — uses Heroui Accordion, Card, Button, Inputapps/web/tailwind.config.ts — defines background, surface, p-primary, accent-blue, explorer-row, etc.If you find yourself writing
style={{ marginTop: '8px' }}, replace it withmt-2. If you need a reusable style pattern, add a Tailwind class or component wrapper, not a CSS module.