Skip to content

Add Project Templates for Reusable Workflows #979

@chrisvel

Description

@chrisvel

Description

Add project templates to enable users to create reusable project structures that can be cloned for recurring workflows. This allows teams to standardize processes (sales events, onboarding, releases, etc.) by creating a template once and duplicating it as needed with updated due dates.

Requested in: Discussion #221

Current State

  • ✅ Project creation with areas, tasks, and subtasks
  • ✅ Task hierarchy (tasks with subtasks)
  • ✅ Project metadata (name, description, status, priority, due dates)
  • ✅ Task templates exist for individual tasks
  • ❌ No project templates (only individual task templates)
  • ❌ No project cloning/duplication functionality
  • ❌ No template management UI

Expected Behavior

For Users:

  • Create a project template from existing project or from scratch
  • Templates include full project structure (tasks, subtasks, hierarchy)
  • Templates preserve task relationships and dependencies
  • Clone template to create new project instance
  • Adjust due dates automatically when cloning (offset from clone date)
  • Templates stored separately from active projects
  • Edit templates without affecting cloned instances

Template Use Cases:

  • Sales process (ads, website updates, promotions)
  • Employee onboarding (setup accounts, training, equipment)
  • Software releases (testing, documentation, deployment)
  • Event planning (venue, catering, marketing)
  • Client onboarding (contracts, setup, kickoff)

Implementation Requirements

1. Database Schema

  • Project template table (template metadata, original project reference)
  • Template flag on projects (mark as template vs active project)
  • Template category/tags for organization
  • Clone history tracking (which instances created from which template)
  • Version tracking for template updates

2. Template Creation

  • "Save as Template" option on existing projects
  • Create new template from scratch
  • Template settings:
    • Name and description
    • Category/tags
    • Visibility (private or shared with team)
    • Default due date offset logic
    • Task completion status reset option

3. Template Cloning

  • "Create from Template" action
  • Clone options dialog:
    • New project name
    • Start date (all due dates adjust relative to this)
    • Area assignment
    • Task status (keep or reset to "Not Started")
    • Subtask inclusion toggle
  • Deep copy all tasks, subtasks, and relationships
  • Maintain task order and hierarchy
  • Preserve tags, priorities, descriptions
  • Reset completion status and dates

4. Due Date Adjustment

  • Calculate offset from original template dates
  • Apply offset to all tasks when cloning
  • Options:
    • Absolute dates (keep original dates)
    • Relative offset (days from start date)
    • Business days only toggle
  • Preserve relative spacing between task due dates

5. Template Management

  • Template library view (grid or list)
  • Search and filter templates (by category, tags, name)
  • Edit template (updates structure for future clones)
  • Delete template (doesn't affect cloned instances)
  • Duplicate template (template from template)
  • Preview template structure before cloning
  • Usage statistics (how many times cloned)

6. Permissions & Sharing

  • Personal templates (visible only to creator)
  • Shared templates (visible to team/organization)
  • Admin-managed templates (organization-wide standards)
  • Permission levels: view, clone, edit, delete
  • Template ownership and transfer

7. User Interface

  • Templates section in sidebar navigation
  • Template library page with cards/list view
  • "Save as Template" button on project detail page
  • "Create from Template" in new project flow
  • Template editor (similar to project editor)
  • Clone configuration dialog
  • Template preview modal

8. Testing & Documentation

  • Unit tests for cloning logic and date calculations
  • Integration tests for full workflow
  • E2E tests for UI interactions
  • User guide for creating and using templates
  • Examples of common template use cases

Environment Variables

  • PROJECT_TEMPLATES_ENABLED - Enable/disable feature (default: true)
  • MAX_TEMPLATES_PER_USER - Limit personal templates (default: 50)
  • SHARED_TEMPLATES_ENABLED - Enable team templates (default: true)

Acceptance Criteria

Template Creation:

  • Users can save existing project as template
  • Users can create template from scratch
  • Templates preserve full project structure
  • Templates include tasks, subtasks, and hierarchy
  • Template metadata stored (name, description, category)

Template Cloning:

  • Users can create project from template
  • Clone dialog allows configuration (name, start date, area)
  • All tasks and subtasks copied correctly
  • Task hierarchy and order preserved
  • Tags, priorities, and descriptions copied

Due Date Handling:

  • Due dates adjust based on start date offset
  • Relative spacing between tasks preserved
  • Option for absolute vs relative dates
  • Business days calculation available

Template Management:

  • Template library displays all templates
  • Search and filter by category/tags
  • Edit template updates future clones only
  • Delete template doesn't affect instances
  • Usage statistics shown

Permissions:

  • Personal templates only visible to creator
  • Shared templates visible to team
  • Permission levels enforced (view, clone, edit)
  • Admin templates organization-wide

UI:

  • Templates section in navigation
  • Template library page complete
  • Clone configuration dialog works
  • Preview shows template structure
  • All tests pass
  • Documentation complete

Additional Context

Approach: Add template flag to projects table, implement deep copy logic for cloning, handle due date offset calculations. Template library as separate view from active projects.

Effort: 30-40 hours (1 week)

Benefits:

  • Standardize recurring workflows
  • Save time on repetitive project setup
  • Ensure consistency across similar projects
  • Reduce errors from manual setup
  • Enable best practice sharing

Related: Discussion #221

Operating System

All

Browser

All

Version

v1.0.0-rc.3 → v1.1.0

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions