Skip to content

patch: Store project type in .template-info metadata #13

@rdwj

Description

@rdwj

Problem

.template-info stores the template URL and commit but not the project type. The patch system needs to know whether it's patching an MCP server, agent, or workflow project to select the right file categories, exclusion patterns, and cloning strategy.

Currently the only way to infer the type is by parsing pyproject.toml dependencies (e.g., looking for fastmcp), which is fragile and doesn't cover all project types.

Proposed change

Add a template.type field to the .template-info JSON written by write_template_info():

{
  "template": {
    "url": "https://github.com/fips-agents/agent-template",
    "type": "agent",
    "subdir": "templates/agent-loop",
    "commit": "abc123def456",
    "full_commit": "abc123def456789..."
  }
}

Fields to add:

  • template.type: one of mcp-server, agent, workflow, gateway, ui, sandbox
  • template.subdir: the subdirectory within the repo (only for monorepo templates like agent/workflow; omit for standalone repos)

Update all write_template_info() call sites in commands/create.py to pass the type and subdir.

Backward compatibility

Existing projects won't have these fields. The patch code should treat a missing template.type as mcp-server (the only type that had patching before).

Part of

Tracking issue: #12

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