Skip to main content

/register-project - Register Project for Dashboard UI

Register a project so it appears in the trajectory dashboard. Handles both database registration (projects.db) and UI visibility configuration (dashboard-projects.json).

System Prompt

EXECUTION DIRECTIVE: When the user invokes this command, you MUST:

  1. Parse arguments — Extract project name (required), optional path, description, source
  2. Check if project exists in projects.db — Query by name (case-insensitive)
  3. If not in projects.db — Register it using project_registration.py
  4. Update dashboard-projects.json — Add project name to visibleProjects array
  5. Verify — Confirm both registrations succeeded
  6. Report results — Show project name, source, visibility status

Does NOT require confirmation — this is a non-destructive additive operation.


Usage

# Register by name (simplest — uses existing projects.db entry)
/register-project coditect-core

# Register with explicit path (auto-detects metadata)
/register-project my-project --path ~/PROJECTS/my-project

# Register with description
/register-project CUST-avivatec-fpa --description "Avivatec FP&A tenant"

# Register with source hint (for adapter categorization)
/register-project "CODITECT Flow Platform" --source projects.db

# List currently registered (visible) projects
/register-project --list

# Remove project from dashboard visibility
/register-project coditect-core --remove

# Regenerate data.json after registration
/register-project my-project --regenerate

What It Does

Step 1: Resolve Dashboard Config Path

# Find dashboard-projects.json
DASHBOARD_DIR = Path(__file__).resolve().parent.parent / "tools" / "trajectory-dashboard"
CONFIG_PATH = DASHBOARD_DIR / "public" / "dashboard-projects.json"

Step 2: Check projects.db Registration

import sqlite3
from scripts.core.paths import get_projects_db_path

db_path = get_projects_db_path()
conn = sqlite3.connect(str(db_path))
cursor = conn.execute(
"SELECT name, project_type, status FROM projects WHERE LOWER(name) = LOWER(?)",
(project_name,)
)
row = cursor.fetchone()
if row:
print(f"✓ Found in projects.db: {row[0]} (type={row[1]}, status={row[2]})")
else:
print(f"⚠ Not in projects.db — registering...")
# Use project_registration.py to register

Step 3: Register in projects.db (if needed)

from scripts.project_registration import register_project

register_project(
project_path=Path(project_path),
name=project_name,
description=description,
project_type="standalone",
)

Step 4: Update dashboard-projects.json

import json

config = {}
if CONFIG_PATH.exists():
with open(CONFIG_PATH) as f:
config = json.load(f)

visible = config.get("visibleProjects", [])
# Case-insensitive check
if not any(v.lower() == project_name.lower() for v in visible):
visible.append(project_name)
config["visibleProjects"] = visible
config["lastUpdated"] = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
config["version"] = "1.0.0"

with open(CONFIG_PATH, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
print(f"✓ Added '{project_name}' to dashboard-projects.json")
else:
print(f"✓ Already in dashboard-projects.json")

Step 5: Optionally Regenerate data.json

# Only if --regenerate flag provided
cd tools/trajectory-dashboard
python3 ../../scripts/trajectory/dashboard_data_adapter.py \
--timeframe all \
--output public/data.json

Options

OptionDescription
nameProject name (required, positional)
--path PATHProject root directory path
--description TEXTProject description
--source TEXTSource hint: projects.db, session-logs, sessions.db
--removeRemove from dashboard visibility (does not unregister from DB)
--listList all currently visible projects
--regenerateRegenerate data.json after registration

Examples

Register the 3 Official Projects

/register-project coditect-core
/register-project CUST-avivatec-fpa
/register-project "CODITECT Flow Platform"

List Current Visibility Config

/register-project --list
# Output:
# Dashboard Visible Projects (3):
# 1. coditect-core [projects.db]
# 2. CUST-avivatec-fpa [session-logs]
# 3. CODITECT Flow Platform [projects.db]

Register New Customer Project

/register-project CUST-acme-erp \
--path ~/PROJECTS/CUST-acme-erp \
--description "ACME Corporation ERP integration" \
--regenerate

Success Output

======================================================
Project Registered for Dashboard
======================================================

Project: coditect-core
Database: ✓ projects.db (existing)
Dashboard: ✓ Added to visibleProjects
Config: tools/trajectory-dashboard/public/dashboard-projects.json

Visible Projects (3):
1. coditect-core
2. CUST-avivatec-fpa
3. CODITECT Flow Platform

Next Steps:
- View dashboard: cd tools/trajectory-dashboard && npm run dev
- Regenerate data: /register-project --regenerate
- Admin panel: Click ⚙️ on Projects page in dashboard

Failure Indicators

This command has FAILED if:

  • Project name is empty
  • dashboard-projects.json cannot be written
  • projects.db is locked or inaccessible

When NOT to Use

Do NOT use when:

  • Creating a brand new project (use /project-new instead)
  • Just want to toggle visibility temporarily (use the admin panel in the dashboard UI)
  • Want to register components within a project (use /component-create)
CommandPurpose
/project-newCreate new project with full CODITECT setup
/component-createCreate components within a project
/component-lifecycleFull component lifecycle (create + improve + index)
/trajectoryOpen trajectory dashboard
/trajectory-dashboardDashboard management

Principles

This command embodies:

  • #3 Complete Execution — Registers in both DB and config in one step
  • #5 Search Before Create — Checks existing registrations first
  • #6 Clear, Understandable — Reports exactly what was registered and where

Full Standard: CODITECT-STANDARD-AUTOMATION.md


Version: 1.0.0 Created: 2026-02-09 Author: Claude (Opus 4.6) Task: J.29.20 ADR: ADR-163