Skip to content

Add AI Developer Framework as a new template category #5

Description

@terchris

Add AI Developer Framework as a new template category

Problem

When a developer creates a new project using dev-setup → "Create project from template", they get application scaffolding (Dockerfile, manifests, source code) but no development methodology. There is no standardized way for AI assistants (Claude Code, Copilot, etc.) and human developers to collaborate using a shared workflow, plan structure, script standards, and validation tools.

Every project that wants AI-assisted development currently has to set up these docs and tools manually, leading to inconsistency across projects.

What is needed

A new template in templates/ called ai-developer-framework that installs a complete AI development methodology into any project. This is not an application template — it's a development workflow layer that can be installed alongside any existing template or into any existing project.

When selected from the template menu, it copies:

  • docs/ai-developer/ — workflow guides, plan structure, script standards, rules, templates, validation tools, and example plans
  • .devcontainer.extend/ — skeleton files (enabled-tools.conf, enabled-services.conf, project-installs.sh)

Template folder structure

templates/ai-developer-framework/
├── TEMPLATE_INFO
├── docs/
│   └── ai-developer/
│       ├── .order
│       ├── README.md
│       ├── WORKFLOW.md
│       ├── PLANS.md
│       ├── DEVCONTAINER-TOOLBOX.md
│       ├── GIT-HOSTING-AZURE-DEVOPS.md
│       ├── GIT-HOSTING-GITHUB.md
│       ├── rules/
│       │   ├── script-standard.md
│       │   ├── bash.md
│       │   └── powershell.md
│       ├── templates/
│       │   ├── README-template.md
│       │   ├── bash/
│       │   │   └── script-template.sh
│       │   └── powershell/
│       │       └── script-template.ps1
│       ├── tools/
│       │   ├── validate-bash.sh
│       │   ├── validate-powershell.sh
│       │   ├── set-version-bash.sh
│       │   └── set-version-powershell.sh
│       ├── plans/
│       │   ├── active/
│       │   ├── backlog/
│       │   └── completed/
│       │       ├── EXAMPLE-INVESTIGATE-auto-version-bump.md
│       │       └── EXAMPLE-PLAN-auto-version-bump.md
│       └── devcontainer-toolbox-issues/
│           ├── README.md
│           ├── ISSUE-azure-devops-cli.md
│           └── ISSUE-vscode-devcontainers-extension.md
└── .devcontainer.extend/
    ├── enabled-tools.conf
    ├── enabled-services.conf
    └── project-installs.sh

TEMPLATE_INFO

TEMPLATE_NAME="AI Developer Framework"
TEMPLATE_DESCRIPTION="Plan-based AI development workflow with rules, templates, and validation tools"
TEMPLATE_CATEGORY="AI_DEV"
TEMPLATE_PURPOSE="Sets up docs/ai-developer with workflow guides, script standards, plan templates, and validation tools for AI-assisted development using Claude Code or similar AI assistants"

What the framework provides

Component Purpose
WORKFLOW.md How to work: investigate → plan → implement phase-by-phase → complete
PLANS.md Plan file structure, templates, status tracking
rules/script-standard.md Universal script metadata (5 fields), logging, help format, error codes
rules/bash.md Bash-specific rules
rules/powershell.md PowerShell-specific rules
templates/ Starter script templates for bash and powershell
tools/validate-*.sh Validates scripts follow the standard (syntax, help, metadata, lint)
tools/set-version-*.sh Bumps SCRIPT_VER across all scripts in a package
plans/completed/EXAMPLE-* Two example files showing the investigate → plan lifecycle
devcontainer-toolbox-issues/ Two example issue files showing how to report toolbox issues
GIT-HOSTING-GITHUB.md GitHub PR/merge/release commands using gh CLI
GIT-HOSTING-AZURE-DEVOPS.md Azure DevOps PR/merge commands using az CLI
DEVCONTAINER-TOOLBOX.md Devcontainer-toolbox command reference

All files are generic — nothing inside docs/ai-developer/ needs editing after installation. The tool scripts accept a SCRIPTS_DIR environment variable to point at the project's script directory (defaults to <repo-root>/scripts/).

Changes needed in dev-template.sh

1. New category: AI_DEV

Add a new associative array and case route:

declare -A CATEGORY_AI_DEV=()

In the category routing case statement:

case "$INFO_TEMPLATE_CATEGORY" in
    WEB_SERVER)
        CATEGORY_WEB_SERVER["$DIR_NAME"]="$INFO_TEMPLATE_NAME|$INFO_TEMPLATE_DESCRIPTION"
        ;;
    WEB_APP)
        CATEGORY_WEB_APP["$DIR_NAME"]="$INFO_TEMPLATE_NAME|$INFO_TEMPLATE_DESCRIPTION"
        ;;
    AI_DEV)
        CATEGORY_AI_DEV["$DIR_NAME"]="$INFO_TEMPLATE_NAME|$INFO_TEMPLATE_DESCRIPTION"
        ;;
    *)
        CATEGORY_OTHER["$DIR_NAME"]="$INFO_TEMPLATE_NAME|$INFO_TEMPLATE_DESCRIPTION"
        ;;
esac

2. Display section in display_template_menu()

Add a new block after the Web App section:

# Display AI Dev templates
if [ ${#CATEGORY_AI_DEV[@]} -gt 0 ]; then
    echo ""
    echo "🤖 AI Development Templates:"
    for dir_name in "${!CATEGORY_AI_DEV[@]}"; do
        IFS='|' read -r name desc <<< "${CATEGORY_AI_DEV[$dir_name]}"
        printf "  %2d. %-35s - %s\n" "$counter" "$name" "$desc"
        counter=$((counter + 1))
    done
fi

In the dev-setup dialog/whiptail TUI, it would appear as a new item with the 🤖 icon:

1  🌐  C# Basic Webserver
2  🌐  Go Basic Webserver
3  🌐  Java Basic Webserver
4  🌐  PHP Basic Webserver
5  🌐  Python Basic Webserver
6  🌐  TypeScript Basic Webserver
7  📱  Designsystemet Basic React App
8  🤖  AI Developer Framework

3. Make verify_template() category-aware

The current verify_template() hard-fails if manifests/deployment.yaml is missing. The AI Developer Framework has no Kubernetes manifests — it's not a deployable application.

Option A — skip validation for AI_DEV category:

function verify_template() {
    echo "Verifying template structure..."

    # AI_DEV templates don't need manifests
    if [ "$INFO_TEMPLATE_CATEGORY" = "AI_DEV" ]; then
        # Check for the docs directory instead
        if [ ! -d "$TEMPLATE_PATH/docs/ai-developer" ]; then
            echo "❌ Required directory 'docs/ai-developer' not found in template."
            rm -rf "$TEMP_DIR"
            exit 1
        fi
        echo "✅ Required template structure verified (AI_DEV)"
        return 0
    fi

    # Existing checks for application templates...
    if [ ! -d "$TEMPLATE_PATH/manifests" ]; then
        ...
    fi
}

Option B — make manifests optional for all templates (check and warn, don't fail). This is more future-proof if other non-application templates are added later.

4. Handle dotfiles in copy_template_files()

The current cp -r "$TEMPLATE_PATH/"* glob does not match dotfiles like .devcontainer.extend/. Either:

  • Add explicit handling for .devcontainer.extend/ (like urbalurba-scripts/ is handled today):
# Copy .devcontainer.extend if present in template
if [ -d "$TEMPLATE_PATH/.devcontainer.extend" ]; then
    echo "Setting up .devcontainer.extend..."
    mkdir -p "$OLDPWD/.devcontainer.extend"
    cp -r "$TEMPLATE_PATH/.devcontainer.extend/"* "$OLDPWD/.devcontainer.extend/"
    echo "✅ Added .devcontainer.extend"
fi
  • Or use cp -r "$TEMPLATE_PATH/"* "$TEMPLATE_PATH/".* "$OLDPWD/" but filter out . and ..

The explicit approach is safer and more consistent with how urbalurba-scripts/ is already handled.

5. Skip variable replacement for AI_DEV

The existing replace_variables() function replaces {{GITHUB_USERNAME}} and {{REPO_NAME}} in manifests and workflows. The AI Developer Framework has no such placeholders, so this step should either be skipped for the AI_DEV category or (more simply) it already won't match any files since there are no manifests or .github/workflows/ directories in this template.

Verify that the existing replacement logic won't fail on missing directories — it likely already handles this gracefully, but worth confirming.

Source

The generic, ready-to-copy docs/ai-developer/ framework is being developed in urbalurba-contentmigrate. Once finalized, the files should be copied into templates/ai-developer-framework/ in this repo.

Summary of changes

What Where Change
New template folder templates/ai-developer-framework/ Add the full framework tree + TEMPLATE_INFO
New category array dev-template.sh Add declare -A CATEGORY_AI_DEV=()
Category routing dev-template.sh Add AI_DEV) case in the routing switch
Menu display dev-template.sh Add 🤖 AI Development Templates section
Template validation dev-template.sh Skip manifest check for AI_DEV category
Dotfile copying dev-template.sh Handle .devcontainer.extend/ explicitly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions