This guide explains how to maintain and extend Loopi's documentation in a structured, scalable way.
| Change Type | Where | What to Update |
|---|---|---|
| New step type | STEPS_REFERENCE.md | Add to "Step Types Reference" section with example JSON |
| New feature | New section in appropriate file or ARCHITECTURE.md | Add with code examples and use cases |
| Bug fix | Minimal or none | Only if behavior changes significantly |
| Variable system change | VARIABLES.md | Update type detection rules or access patterns |
| Architecture change | ARCHITECTURE.md | Update relevant section with new diagrams/flows |
| API endpoint change | STEPS_REFERENCE.md | Update API Call section with new fields |
ARCHITECTURE.md - For developers
- System design and data flows
- Process architecture (main/renderer)
- Type system design
- Security model
- Extension points for adding features
GETTING_STARTED.md - For new users
- Installation steps
- Building first automation
- Common patterns
- Troubleshooting
VARIABLES.md - For all users
- Variable syntax and access patterns
- Type detection rules
- API response handling
- Best practices and examples
STEPS_REFERENCE.md - For all users
- All step types with examples
- Field references
- Tips for each step type
Use this structured approach:
Add to the "Step Types Reference" section following this format:
#### YourNewStep
Brief description of what the step does.
**Basic example:**
```json
{
"type": "yourNewStep",
"field1": "value",
"field2": "value"
}With variables:
{
"type": "yourNewStep",
"field1": "{{variableName}}"
}Key features:
- Feature 1 description
- Feature 2 description
Common use cases:
- Use case 1
- Use case 2
If the step requires special handling:
### YourNewStep
**Type Definition** (in `src/types/steps.ts`):
```typescript
interface StepYourNewStep extends StepBase {
type: "yourNewStep";
field1: string;
field2?: string;
}Execution Logic (in src/main/automationExecutor.ts):
- How it's executed
- Special behavior or requirements
UI Component (in src/components/automationBuilder/nodeDetails/stepTypes/):
- Component structure
- Key interactions
Add to docs/examples/:
- File:
your_step_example.json - Include 2-3 steps showing the new step in context
- Add comment or use case in STEPS_REFERENCE.md linking to example
In order:
src/types/steps.ts- Add type definitionsrc/components/automationBuilder/nodeDetails/stepTypes/- Add editor componentsrc/main/automationExecutor.ts- Add execution logicsrc/hooks/useNodeActions.ts- Add initial valuessrc/components/automationBuilder/nodeDetails/StepEditor.tsx- Add to switch
Create a new subsection:
## FeatureName
**Purpose:** Brief explanation
**Components Involved:**
- Component1 - Role
- Component2 - Role
**Data Flow:**Flow diagram
**Key Implementation Details:**
- Detail 1
- Detail 2
**Extension Points:**
- How to extend this feature
If affecting variables, update VARIABLES.md; if affecting execution, update GETTING_STARTED.md, etc.
Add to docs/examples/ if it benefits from a concrete example.
Before committing code changes:
- STEPS_REFERENCE.md - New step types added with examples?
- VARIABLES.md - Variables system changes documented?
- ARCHITECTURE.md - Major architectural changes explained?
- GETTING_STARTED.md - New features explained in "Building More Complex Automations"?
- Code comments - Complex logic has inline comments?
- Examples - Real-world example JSON added if applicable?
- Type definitions - Code matches documentation?
Documenting variable access:
**Simple syntax:** `{{variableName}}`
**With nesting:** `{{object.property}}`
**With arrays:** `{{array[0]}}`
**Combined:** `{{array[0].property}}`
*API responses are stored as objects - see [VARIABLES.md](./VARIABLES.md) for details*Documenting step fields:
| Field | Type | Required | Notes |
|-------|------|----------|-------|
| selector | string | Yes | CSS selector for element |
| value | string | No | Supports `{{variables}}` |
| operation | enum | Yes | Options: set, increment, decrement, append |Referencing other docs:
For detailed information, see [VARIABLES.md](./VARIABLES.md#automatic-type-detection)
For step examples, see [STEPS_REFERENCE.md](./STEPS_REFERENCE.md)All documentation files use:
- Markdown with proper heading hierarchy (# > ## > ### > ####)
- Code blocks with language tags (
typescript,json, etc.) - Emphasis for important terms (using emphasis or bold)
- Links to related documentation
- Examples for every major concept
- Line length max 100 characters (wrap longer lines)
When updating documentation:
- Group related changes - If adding a step, update STEPS_REFERENCE.md + ARCHITECTURE.md + example in one commit
- Use clear commit messages - "docs: Add DatePicker step documentation" not just "update docs"
- Avoid massive documentation rewrites - Update incrementally
- Test links - Verify relative links work (use
./FILE.mdnotFILE.md)
- Keep it current - Update docs when code changes
- Real examples > theoretical - Actual JSON and code over abstract descriptions
- Link strategically - Cross-reference related concepts
- Update checklist - Use the Documentation Update Checklist before commits
- Simple language - Avoid jargon; define terms when first introduced
- Copy from similar - When adding a step, copy STEPS_REFERENCE.md section from similar step