Skip to content

Instantly share code, notes, and snippets.

@shawn2024bellazan-prog
Last active April 6, 2026 06:49
Show Gist options
  • Select an option

  • Save shawn2024bellazan-prog/bbd14268ad5b9c0517f6ac3598bcb1f1 to your computer and use it in GitHub Desktop.

Select an option

Save shawn2024bellazan-prog/bbd14268ad5b9c0517f6ac3598bcb1f1 to your computer and use it in GitHub Desktop.
name pmcro-project-generator
description Generates a complete, production-ready PMCR-O Cognitive Architecture .NET 10 Aspire project as a downloadable ZIP file. The generated project follows the real PMCRO substrate pattern: Aspire AppHost, gRPC-internal / REST-external hybrid, Microsoft Agent Framework (MAF) phase services (Planner, Maker, Checker, Reflector, OrchestratorService, OrchestrationApi), MCP actuators with three pillars (Tools + Resources + Prompts), Central Package Management, Directory.Build.props/targets, SKILL.md per service, and SeedIntent injection. Use this skill whenever a user provides a CompanyName, ProjectName, and SeedIntent and wants to scaffold a full PMCRO project. Triggers on: "generate PMCRO project", "scaffold cognitive architecture", "new PMCRO project", "generate project zip", "dotnet new pmcro", or any combination of intent + project name implying a PMCRO scaffold is desired.
compatibility .NET 10 | C# 14 | Aspire 13.x | MAF 1.0.0-rc2 | MCP 1.2.0 | gRPC | Docker

PMCRO Cognitive Architecture Project Generator v2

Generates a complete, production-ready .NET 10 Aspire PMCRO project from three parameters.

Input Contract

Parameter Example Description
CompanyName Tooensure PascalCase company — becomes namespace root + folder prefix
ProjectName CogArch PascalCase project — combined as CompanyName.ProjectName everywhere
SeedIntent "Develop PMCR-O Cognitive Architecture" Injected into InitFrame, TRAIN-000, SKILL.md files, Directory.Build.props

If any are missing, ask before generating.


Generation Workflow

  1. Confirm all three parameters.
  2. Run scripts/generate_project.py --company X --name Y --intent Z --output /path/
  3. Script produces CompanyName.ProjectName.zip.
  4. Present the ZIP via present_files.
python3 /path/to/pmcro-v2/scripts/generate_project.py \
  --company "CompanyName" \
  --name "ProjectName" \
  --intent "SeedIntent" \
  --output /mnt/user-data/outputs/

What Gets Generated

See references/project-structure.md for the complete file tree.

Architecture

External REST (HTTP)
      │
      ▼
OrchestrationApi (:8080)
      │
      │ gRPC (internal)
      ▼
OrchestratorService (:7075)
   │    │    │    │
   │    │    │    └─► ReflectorService (:7074)   [gRPC]
   │    │    └──────► CheckerService (:7073)     [gRPC]
   │    └───────────► MakerService (:7072)       [gRPC]
   └────────────────► PlannerService (:7071)     [gRPC]
                           │
                    MCP Actuators (HTTP)
                    ├── Mcp.FileSystem (:7221)
                    ├── Mcp.Playwright (:7273)
                    └── Mcp.Git       (:7222)

Key Pillars

Infrastructure:

  • Directory.Build.props — net10.0, C# latest, ArtifactsPath, SeedIntent MSBuild property
  • Directory.Build.targets — SKILL.md → output copy + VerifyPmcroIdentity target
  • Directory.Packages.props — Central Package Management (ALL versions, no Version= in csproj)
  • .template.config/template.jsondotnet new pmcro -company X -name Y -intent Z

AppHost (Aspire):

  • All services + MCPs registered with named endpoints
  • WaitFor chains: phase agents wait for MCPs; Orchestrator waits for all phases; Api waits for Orchestrator
  • WithEnvironment("SeedIntent", ...) injected into every service

Phase Services (gRPC internal, MAF):

  • CompanyName.ProjectName.Contracts — shared .proto files + generated stubs
  • PlannerService, MakerService, CheckerService, ReflectorService — each with SKILL.md + gRPC impl
  • OrchestratorService — governs the loop, issues EXTEND/ACCEPT/ESCALATE/LOOP/INTERRUPT verdicts
  • OrchestrationApi — sole external REST surface, minimal controller, maps to OrchestratorService gRPC

MCP Actuators (3-pillar: Tools + Resources + Prompts):

  • Mcp.FileSystem — TYPE 1 write + TYPE 2 read, full LocalFileSystemService, path sandboxing
  • Mcp.Playwright — browser automation, snapshot_page, browser_click, browser_type
  • Mcp.Git — git read (TYPE 2) + write (TYPE 1) operations

Shared Libraries:

  • CompanyName.ProjectName.Core — domain entities, EF DbContext, trail records
  • CompanyName.ProjectName.AISovereignInference, SovereignSkillsProvider
  • CompanyName.ProjectName.ServiceDefaults — OpenTelemetry, health checks, service discovery

Laws (Never Violate)

  • NEVER add Version= to any <PackageReference> — all versions in Directory.Packages.props
  • NEVER hardcode CompanyName or ProjectName — template tokens replace everything
  • NEVER add gRPC to an MCP project — MCPs are actuators, not phase agents
  • NEVER add Microsoft.Agents.AI to an MCP project
  • ALWAYS include SKILL.md in every project with I AM declaration
  • ALWAYS use WithToolsFromAssembly() / WithResourcesFromAssembly() / WithPromptsFromAssembly()
  • ALWAYS classify MCP tools as TYPE 1 (Orchestrator-only write) or TYPE 2 (any cognitive service read)
  • ALWAYS use Stateless = true on HTTP MCP transport
name pmcro-project-generator
description Generates a complete, production-ready PMCR-O Cognitive Architecture .NET project as a downloadable ZIP file. Use this skill whenever a user provides a project name and seed intent and wants to scaffold a full PMCR-O project. Triggers on phrases like: "generate PMCR-O project", "create cognitive architecture project", "scaffold PMCR-O", "new PMCR-O project", "generate project zip", or any combination of intent + project name that implies a PMCR-O / cognitive architecture scaffold is desired. Also triggers when user provides an intent string and asks for a project, template, or architecture to be generated around it.

PMCR-O Cognitive Architecture Project Generator

Generates a complete, zipped .NET PMCR-O Cognitive Architecture project scaffold from a ProjectName and SeedIntent.

Input Contract

The user must provide (or Claude must ask for) two things:

Parameter Example Description
ProjectName Tooensure.CogArch PascalCase .NET project name — used everywhere as the namespace / folder root
SeedIntent "Develop PMCR-O Cognitive Architecture" The cognitive seed — injected into InitFrame, TRAIN-000, DocFX, SKILL templates, MSBuild props

If either is missing, ask for it before proceeding. Do NOT generate with placeholder values.


Generation Workflow

  1. Resolve parameters — confirm ProjectName and SeedIntent with the user.
  2. Run the generator scriptscripts/generate_project.py produces the full folder tree and writes every file.
  3. Zip the output — the script zips everything into {ProjectName}.zip.
  4. Present the ZIP — use present_files to deliver the download.

Running the generator

python3 /path/to/pmcro-project-generator/scripts/generate_project.py \
  --name "ProjectName" \
  --intent "SeedIntent" \
  --output /mnt/user-data/outputs/

The script exits 0 on success and prints the zip path to stdout.


What Gets Generated

See references/project-structure.md for the complete file tree.

Key pillars:

1. template.json — .NET Template Config

  • sourceName: "ProjectName" wires all replacements
  • SeedIntent symbol with replaces: "SEED_INTENT_VALUE"
  • -intent alias parameter
  • MSBuild property injection via Directory.Build.props

2. src/ — C# Source Projects

Project Purpose
ProjectName.Pmcro Plan / Make / Check / Reflect / Orchestrate phases + InitFrame + OMode selector
ProjectName.Agent Agent boot, TRAIN frame recorder, agentic loop
ProjectName.McpServer MCP server host, Skill loader, tool registration
ProjectName.Shared Constants, extensions, models

3. skills/ — Full Skill Architecture

  • /file-system, /browser, /skill-runtime — each with SKILL.md + scripts
  • /templates — minimal, multi-tool, PMCR-O-aware, TRAIN-aware SKILL templates
  • All SKILL.md files have SEED_INTENT_VALUE injected

4. evals/ — Evaluation Suite

  • eval.json — master eval config
  • /templates — correctness, reasoning, safety, pmcr-o, TRAIN evals
  • /examples — file-system and browser example evals

5. docs/ — DocFX Site

  • docfx.json, root toc.yml, index.md (SeedIntent injected)
  • /articles — agentic loop, Beacon GIS walkthrough, browser tools, skill architecture, PMCR-O phases, TRAIN frames
  • /assets/diagrams — SVG-ready diagram stubs (agentic-loop, skill-lifecycle, pmcr-o-loop, train-flow)

6. Directory.Build.props — MSBuild Stamping

<PropertyGroup>
  <SeedIntent>SEED_INTENT_VALUE</SeedIntent>
</PropertyGroup>

Key Files Reference

Read references/project-structure.md for the complete tree. Read references/file-contents.md for the exact content of every generated file.


Quality Rules

  • Every occurrence of ProjectName in file names, folder names, namespaces, and content is the literal string — replaced at dotnet new time.
  • Every occurrence of SEED_INTENT_VALUE in content is the literal string — replaced at dotnet new time.
  • No placeholder values like TODO or MyProject may appear in the generated output.
  • The ZIP must be self-contained and buildable: dotnet build must succeed after extraction.
  • DocFX site must build: docfx docfx.json must succeed after extraction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment