Jay Stack Full Workflow Lifecycle
Jay Stack Full Workflow Lifecycle
Written for AI agents. See Log Methodology Note below for details.
Date: February 4, 2026
Status: Draft
Related: Design Logs #50, #80, #84, #85
Background
Jay Stack has multiple stages from project setup to runtime. Several pieces exist (CLI commands, rendering phases, plugin system, agent-kit) but the full lifecycle is not tracked as a coherent workflow. Understanding the lifecycle is important for:
- Knowing which CLI commands/steps exist or are needed at each stage
- Ensuring plugins can hook into the right lifecycle points
- Giving agents (and developers) a clear sequence to follow
Lifecycle Phases
┌─────────────────────────────────────────────────────────┐
│ 1. PROJECT SETUP │
│ create project, install plugins │
├─────────────────────────────────────────────────────────┤
│ 2. PLUGIN SETUP │
│ configure plugins, generate reference info │
├─────────────────────────────────────────────────────────┤
│ 3. AGENT KIT │
│ materialize contracts, prepare instructions/content │
├─────────────────────────────────────────────────────────┤
│ 4. DEVELOPMENT (agent or human coding) │
│ generate/write pages, components, contracts │
├─────────────────────────────────────────────────────────┤
│ 5. SLOW RENDER (build / dev server start) │
│ static generation, SSG, slow phase │
├─────────────────────────────────────────────────────────┤
│ 6. FAST RENDER (SSR / request time) │
│ per-request data, session-aware rendering │
├─────────────────────────────────────────────────────────┤
│ 7. INTERACTIVE (CSR / client-side) │
│ hydration, signals, reactive updates │
├─────────────────────────────────────────────────────────┤
│ 8. SLOW REFRESH (data change → re-render) │
│ incremental slow re-render for specific routes │
└─────────────────────────────────────────────────────────┘
Phase Details
Phase 1: Project Setup
What happens: Developer creates a new project, installs plugins.
Existing:
npm init/ project scaffoldnpm installplugins (e.g.,@wix/stores,@wix/data)
CLI: None specific to jay-stack yet for project creation.
No new commands needed - standard npm workflow.
Phase 2: Plugin Setup
What happens: Plugins are configured. Some plugins (like wix-data) need initial configuration and can generate reference files, default configs, or seed data after basic setup.
Example: After installing @wix/data, the developer runs a setup command. The plugin:
- Creates default collection schemas
- Generates reference config files
- Seeds initial data (if applicable)
- Validates plugin prerequisites (API keys, etc.)
Question: Should this be a dedicated CLI command?
Answer: Yes. Plugins need a lifecycle hook for post-install setup.
Proposed command:
# Run setup for all installed plugins
jay-stack setup
# Run setup for a specific plugin
jay-stack setup wix-stores
# Re-run setup (e.g., after config change)
jay-stack setup wix-data --force
What jay-stack setup does:
- Scans installed plugins for a
setupexport orsetupentry inplugin.yaml - Runs each plugin's setup function
- Plugin setup can:
- Create/update config files (in
src/or project root) - Generate reference data (write to
agent-kit/references/or project-level config) - Validate configuration (API keys, connections)
- Report status (configured/needs-attention)
- Create/update config files (in
Plugin.yaml extension:
# plugin.yaml
name: wix-data
setup:
handler: ./setup.js # Setup function entry point
description: Configure CMS collections and seed data
creates:
- src/data/collections/ # Files/dirs this setup creates
When to run: After install, before agent-kit. Not automatic - developer explicitly runs it.
Phase 3: Agent Kit
What happens: Prepare everything an agent needs to generate pages.
Existing:
jay-stack contracts- materializes contracts to disk- Design Log #85 defines
agent-kit/folder structure
Proposed: Rename/extend to jay-stack agent-kit (as in #85):
- Materialize dynamic contracts →
agent-kit/materialized-contracts/ - Generate contracts-index.yaml and plugins-index.yaml
- Ensure INSTRUCTIONS.md is present
- Optionally run
jay-stack paramsfor all components with load params
CLI:
jay-stack agent-kit # Full agent-kit generation
jay-stack params <contract> # Discover load param values (from #84 Phase 1b)
jay-stack action <action> # Run plugin action for data discovery
Phase 4: Development (Agent or Human Coding)
What happens: Agent or developer creates/edits pages, components, contracts.
Agent workflow:
- Read
agent-kit/INSTRUCTIONS.md - Read contracts-index, plugins-index
- Read content files from
agent-kit/content/ - Generate
src/pages/**/page.jay-html,page.jay-contract,page.conf.yaml
Human workflow:
- Write jay-html templates, TypeScript components
- Use
jay-stack validateto check files
Existing CLI:
jay-stack validate- validates .jay-html and .jay-contract filesjay-stack validate-plugin- validates plugin packages
Phase 5: Slow Render (Build Time)
What happens: Static site generation. All slow-phase data is resolved, templates are rendered with slow ViewState, carry-forward data is stored.
Existing:
- Dev server runs slow rendering on startup
- Build (not yet fully implemented) would do the same
What runs:
- For each page: resolve slow props (static values, load params)
- Call component's
slowlyRender(props)→ slow ViewState + carryForward - Transform jay-html template with slow ViewState
- Store rendered HTML + carryForward for fast phase
- Cache results (page-level caching, includes nested component slow renders)
CLI:
jay-stack dev- dev server (includes slow render)jay-stack build(future) - production build
Phase 6: Fast Render (SSR / Request Time)
What happens: Per-request rendering. Session-aware, dynamic data injected.
What runs:
- Receive HTTP request
- For each page: call component's
fastRender(carryForward)→ fast ViewState - Merge fast ViewState into pre-rendered HTML
- For nested components: pass their stored carryForward, get fast ViewState
- Serve complete HTML + client scripts
No new CLI - this is the server runtime.
Phase 7: Interactive (CSR / Client-Side)
What happens: Browser hydrates, signals activate, interactive elements wire up.
What runs:
- Client runtime initializes
makeJayComponentattaches to DOM elements- Signals created from interactive ViewState
- Event handlers wire up to refs
- Plugin's
interactiveConstructorruns
No CLI - this is client runtime.
Phase 8: Slow Refresh (Data Change)
What happens: External data changes (e.g., product updated in CMS). The slow render for affected routes needs to re-run.
Question: Should this be a dedicated CLI command?
Answer: Yes, but not for now. This is a future optimization for when the build product is implemented.
Proposed (future):
# Re-render slow phase for a specific route
jay-stack refresh /shop/products/[slug]
# Re-render slow phase for all routes using a specific contract
jay-stack refresh --contract wix-stores/product-page
# Re-render all routes
jay-stack refresh --all
What it does:
- Identify affected routes (by path or by contract dependency)
- Re-run slow render for those routes only
- Update cached slow-render output
- Optionally trigger rebuild of static assets
Not building this now - depends on the build product phase being implemented first.
Summary: CLI Commands by Phase
| Phase | Command | Status | Description |
|---|---|---|---|
| 2. Plugin Setup | jay-stack setup [plugin] |
New | Run plugin post-install setup |
| 3. Agent Kit | jay-stack agent-kit |
Proposed (#85) | Materialize contracts + kit |
| 3. Agent Kit | jay-stack contracts |
Exists | Materialize contracts |
| 3. Agent Kit | jay-stack params <contract> |
Proposed (#84) | Discover load param values |
| 3. Agent Kit | jay-stack action <action> |
Proposed (#84) | Run plugin action |
| 4. Development | jay-stack validate |
Exists | Validate project files |
| 4. Development | jay-stack validate-plugin |
Exists | Validate plugin package |
| 5. Slow Render | jay-stack dev |
Exists | Dev server (slow + fast + interactive) |
| 5. Slow Render | jay-stack build |
Future | Production build |
| 8. Slow Refresh | jay-stack refresh [route] |
Future | Re-render slow phase for route |
Questions
Q1: Should jay-stack setup be interactive or headless?
Answer: Headless. Reads config, generates files. No interactive prompts.
Q2: Should jay-stack agent-kit subsume jay-stack contracts?
Answer: Handled by Design Log #85. No additional action here.
Q3: Where does jay-stack setup write plugin config?
Answer: Plugin decides where to write. No framework-level convention for now.
Q4: Should jay-stack refresh invalidate cache selectively?
Yes. The slow-render cache is page-level. Refresh should:
- Identify which cache entries are affected
- Re-render only those
- This requires tracking which contracts/data sources each page depends on
This is a future concern - cache dependency tracking needs to be designed when we build the production build system.
Implementation Priority
jay-stack setup- Needed before agent-kit works well (plugins need to be configured first)jay-stack agent-kit- Needed for agentic generation (extends existingcontractscommand)jay-stack params- Needed for agents to discover load param valuesjay-stack action- Needed for agents to discover dynamic datajay-stack refresh- Future, depends on build product
Log Methodology Note
Note: These design logs are written primarily for AI agents as part of the Design Log methodology and made accessible here for human readers. The language and structure are optimized for machine consumption — expect precise, specification-style prose rather than narrative documentation.