Standards & Reference
User Documentation
This document defines the standards and processes for maintaining comprehensive user documentation for the Flowstate application.
Table of Contents
- Overview
- Documentation Types
- Help Center Integration
- Screenshot Standards
- Workflow Guides
- Automation Process
- Maintenance Lifecycle
- Documentation Templates
Overview
All dashboard screens and features will have associated documentation in the Help Center. This documentation serves as the primary reference for users to understand functionality, complete workflows, and troubleshoot issues.
Core Principles
- Completeness: Every feature has corresponding documentation
- Currency: Documentation is updated with every feature change
- Accessibility: Documentation is easily discoverable from within the application
- Visual: Screenshots and visual guides accompany text instructions
- Automation: Documentation updates are integrated into the development workflow
Documentation Types
1. Feature Documentation
Comprehensive guides for each major feature area:
| Feature Area | Documentation Scope |
|---|---|
| Dashboard | Overview, widgets, customization |
| Events | Creating, editing, managing events |
| Deliverables | Tracking, approvals, reporting |
| Reports | Generation, filtering, exporting |
| User Management | Roles, permissions, profiles |
| Settings | Configuration, preferences |
2. Workflow Guides
Step-by-step instructions for completing common tasks:
- Creating a new event
- Submitting deliverables for approval
- Generating reports
- Managing user permissions
- Configuring notifications
3. Quick Reference Cards
Single-page summaries for rapid lookup:
- Keyboard shortcuts
- Status definitions
- Role permissions matrix
- Common error resolutions
4. Release Notes
User-facing summaries of changes:
- New features
- Improvements
- Bug fixes
- Breaking changes
5. FAQ
Frequently asked questions organized by topic:
- Account & Access
- Events & Deliverables
- Reports & Analytics
- Troubleshooting
Help Center Integration
In-App Help Links
Every screen includes contextual help access:
// Component pattern for help integration
interface HelpLinkProps {
articleId: string;
section?: string;
}
const HelpLink: React.FC<HelpLinkProps> = ({ articleId, section }) => {
const helpUrl = `/help/articles/${articleId}${section ? `#${section}` : ''}`;
return (
<a href={helpUrl} target="_blank" rel="noopener noreferrer">
<HelpCircle className="h-4 w-4" />
</a>
);
};
Article ID Convention
{feature-area}-{topic}-{subtopic}
Examples:
- events-create-basic
- events-create-deliverables
- reports-export-pdf
- admin-users-permissions
Help Center Structure
help/
├── getting-started/
│ ├── overview.md
│ ├── first-login.md
│ └── navigation.md
├── events/
│ ├── overview.md
│ ├── creating-events.md
│ ├── managing-deliverables.md
│ └── event-timeline.md
├── reports/
│ ├── overview.md
│ ├── generating-reports.md
│ └── exporting-data.md
├── admin/
│ ├── user-management.md
│ ├── permissions.md
│ └── settings.md
└── troubleshooting/
├── common-issues.md
└── error-codes.md
Screenshot Standards
Capture Requirements
| Aspect | Standard |
|---|---|
| Resolution | 1920x1080 (Full HD) |
| Format | PNG with transparency support |
| Browser | Chrome (latest stable) |
| Viewport | Desktop default (1280x720 minimum) |
| Theme | Light mode (default) |
| Data | Use sanitized sample data |
Annotation Guidelines
- Callouts: Use numbered circles (1, 2, 3) for sequential steps
- Highlights: Red borders (#EF4444) for areas of focus
- Arrows: Directional arrows for flow indication
- Text Labels: Clear, concise labels in sans-serif font
File Naming Convention
{feature}_{action}_{step-number}_{description}.png
Examples:
- events_create_01_open-form.png
- events_create_02_fill-details.png
- events_create_03_add-deliverables.png
- events_create_04_submit.png
Screenshot Directory Structure
docs/screenshots/
├── events/
│ ├── create/
│ ├── edit/
│ └── view/
├── reports/
│ ├── generate/
│ └── export/
├── admin/
│ ├── users/
│ └── settings/
└── common/
├── navigation/
└── notifications/
Workflow Guides
Guide Template
Each workflow guide follows this structure:
# [Action] [Feature]
## Overview
Brief description of what this workflow accomplishes.
## Prerequisites
- Required permissions
- Required data/setup
- Related features
## Steps
### Step 1: [Action]
[Description]

### Step 2: [Action]
[Description]

## Expected Results
What the user should see upon completion.
## Troubleshooting
Common issues and resolutions.
## Related Topics
- [Related Guide 1](./related-1.md)
- [Related Guide 2](./related-2.md)
Workflow Checklist
Before publishing a workflow guide:
- [ ] All steps are numbered sequentially
- [ ] Screenshots match current UI
- [ ] Prerequisites are clearly stated
- [ ] Expected results are defined
- [ ] Troubleshooting section addresses common issues
- [ ] Related topics are linked
- [ ] Reviewed by QA
- [ ] Reviewed by product owner
Automation Process
Screenshot Automation
Screenshots are automatically captured during E2E test runs:
// e2e/utils/documentation.ts
export async function captureDocScreenshot(
page: Page,
feature: string,
action: string,
step: number,
description: string
): Promise<void> {
const filename = `${feature}_${action}_${step.toString().padStart(2, '0')}_${description}.png`;
const filepath = `docs/screenshots/${feature}/${action}/${filename}`;
await page.screenshot({
path: filepath,
fullPage: false,
});
}
Documentation Generation Pipeline
# .github/workflows/docs.yml
name: Documentation
on:
push:
paths:
- 'src/**'
- 'e2e/**'
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Run documentation tests
run: npm run test:e2e:docs
- name: Generate screenshots
run: npm run docs:screenshots
- name: Update help articles
run: npm run docs:update
- name: Commit changes
run: |
git config user.name "Documentation Bot"
git config user.email "docs@bot.local"
git add docs/
git commit -m "docs: update documentation" || exit 0
git push
Change Detection
Documentation updates are triggered when:
- Component Changes: UI components modified
- Route Changes: Navigation structure updated
- Feature Additions: New features added
- Feature Removals: Features deprecated or removed
// scripts/detect-doc-changes.ts
interface DocChange {
type: 'add' | 'modify' | 'remove';
feature: string;
files: string[];
requiredUpdates: string[];
}
async function detectDocumentationChanges(
changedFiles: string[]
): Promise<DocChange[]> {
const changes: DocChange[] = [];
// Map file changes to documentation requirements
for (const file of changedFiles) {
if (file.includes('src/views/')) {
const feature = extractFeatureFromPath(file);
changes.push({
type: 'modify',
feature,
files: [file],
requiredUpdates: [
`docs/help/${feature}/overview.md`,
`docs/screenshots/${feature}/`,
],
});
}
}
return changes;
}
Maintenance Lifecycle
Documentation Review Cycle
| Trigger | Action | Responsibility |
|---|---|---|
| Feature Release | Full documentation review | Product Owner |
| Bug Fix | Update if UI affected | Developer |
| Quarterly | Comprehensive audit | Documentation Team |
| User Feedback | Address gaps | Support Team |
Version Alignment
Documentation versions align with application releases:
docs/
├── v2.0/ # Current version
├── v1.9/ # Previous version
└── archive/ # Older versions
Deprecation Process
When features are deprecated:
- Mark documentation as deprecated
- Add migration guidance
- Maintain for 2 release cycles
- Archive after removal
> **Deprecated**: This feature will be removed in v3.0.
> See [Migration Guide](./migration.md) for alternatives.
Documentation Templates
Feature Overview Template
# [Feature Name]
## What is [Feature]?
Brief description of the feature and its purpose.
## Key Capabilities
- Capability 1
- Capability 2
- Capability 3
## Getting Started
Link to quickstart guide.
## Common Tasks
- [Task 1](./task-1.md)
- [Task 2](./task-2.md)
## Best Practices
Recommendations for effective use.
## FAQ
Link to feature-specific FAQ.
How-To Guide Template
# How to [Action]
**Time Required**: X minutes
**Skill Level**: Beginner/Intermediate/Advanced
**Prerequisites**: List requirements
## Overview
What this guide covers.
## Steps
### 1. [First Step]
Description and screenshot.
### 2. [Second Step]
Description and screenshot.
## Verification
How to confirm success.
## Next Steps
What to do after completing this task.
Troubleshooting Template
# Troubleshooting: [Issue Category]
## [Error/Issue Name]
### Symptoms
- What the user sees
- Error messages
### Cause
Why this happens.
### Solution
Step-by-step resolution.
### Prevention
How to avoid this issue.
Quality Metrics
Documentation Health Indicators
| Metric | Target | Measurement |
|---|---|---|
| Coverage | 100% | Features with docs / Total features |
| Freshness | < 30 days | Days since last update |
| Accuracy | > 95% | Screenshots matching current UI |
| Completeness | 100% | Required sections present |
| User Rating | > 4.0/5.0 | Help article feedback |
Automated Checks
// scripts/validate-docs.ts
interface DocValidation {
file: string;
issues: string[];
isValid: boolean;
}
async function validateDocumentation(): Promise<DocValidation[]> {
const results: DocValidation[] = [];
// Check for broken links
// Verify screenshot existence
// Validate required sections
// Check for outdated content markers
return results;
}
Tools and Resources
Recommended Tools
| Tool | Purpose |
|---|---|
| Playwright | Screenshot automation |
| Markdown | Documentation format |
| Docusaurus | Help center platform |
| Algolia | Search functionality |
| GitHub Actions | Automation pipeline |
Style Guide
- Use active voice
- Keep sentences concise
- Use numbered lists for sequential steps
- Use bullet lists for non-sequential items
- Include screenshots for visual guidance
- Define technical terms on first use
- Link to related documentation
Package Documentation System
Overview
The documentation site automatically aggregates documentation from individual packages in the monorepo. Each package can enable documentation by adding configuration and markdown files.
Enabling Documentation for a Package
1. Add documentation config
Add a documentation section to your package's .flowstate/config.json:
{
"documentation": {
"enabled": true,
"type": "app",
"title": "Your Package Title",
"description": "Brief description",
"category": "apps",
"order": 1
}
}
Configuration fields:
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Set true to include in docs site |
type | "app" | "library" | Yes | Determines template and API doc generation |
title | string | Yes | Display name in navigation |
description | string | No | Short description for search/metadata |
category | string | Yes | Groups packages in sidebar |
order | number | No | Sort order within category |
Categories:
apps- User-facing applicationscore- Core librariesintegrations- External service integrationstools- CLI tools and utilities
2. Create documentation files
Create a .flowstate/docs/ directory in your package with at minimum an index.md file:
packages/your-package/.flowstate/
└── docs/
└── index.md # Required: Package overview
Use the templates at .flowstate/templates/documentation/:
app/- Template for user-facing applicationslibrary/- Template for developer libraries
IMPORTANT - Subdirectory Structure Required:
Next.js App Router requires each documentation page (except the root index.md) to be in its own subdirectory. The sync script renames index.md files to page.md for routing.
docs/
├── index.md # Root page (stays as index.md)
├── getting-started/
│ └── index.md # -> getting-started/page.md
├── features/
│ └── index.md # -> features/page.md
├── workflows/
│ └── my-workflow/
│ └── index.md # -> workflows/my-workflow/page.md
└── troubleshooting/
└── index.md # -> troubleshooting/page.md
DO NOT create flat files like getting-started.md directly in the docs folder - they will result in 404 errors.
3. Run the sync script
yarn workspace @epicdm/flowstate-docs docs:sync
This will:
- Discover packages with
documentation.enabled: true - Copy markdown files to the documentation site
- Generate API docs from TSDoc (libraries only)
- Update the navigation manifest
Markdown Frontmatter
Each markdown file should include YAML frontmatter:
---
title: Page Title
order: 1
description: Brief page description
---
title- Display title in navigation and page headerorder- Sort order (lower numbers appear first)description- Used in search and metadata
Code Block Requirements
All code blocks MUST have a language identifier. The documentation site uses syntax highlighting that requires a language to be specified. Code blocks without a language will cause runtime errors.
<!-- CORRECT -->
```typescript
const x = 1;
```text
<!-- CORRECT - use 'text' for ASCII diagrams -->
```text
┌─────────┐
│ Box │
└─────────┘
```text
<!-- INCORRECT - will cause errors -->
const x = 1;
Common language identifiers:
| Language | Use For |
|---|---|
typescript | TypeScript code |
javascript | JavaScript code |
json | JSON configuration |
yaml | YAML frontmatter examples |
bash | Shell commands |
text | ASCII diagrams, plain text, directory trees |
markdown | Markdown examples |
TSDoc API Documentation
For library packages (type: "library"), the sync script automatically extracts API documentation from TSDoc comments in your TypeScript source files.
Supported TSDoc tags:
@description/ description text - Function/class description@param- Parameter documentation@returns- Return value documentation@example- Code examples
Build Integration
Documentation sync runs automatically before the docs site build:
# Manual sync
yarn workspace @epicdm/flowstate-docs docs:sync
# Build (runs sync first via prebuild hook)
yarn workspace @epicdm/flowstate-docs build
Generated Files
The following files are auto-generated and gitignored:
packages/documentation/src/app/docs/*/- Copied package docspackages/documentation/src/lib/navigation.generated.json- Navigation manifest
Related Documents
- CHANGELOG.md - Release notes process
- BAT.md - Screenshot automation with Playwright
- PROCESS.md - Development workflow