generated from coulomb/repo-seed
225 lines
7.3 KiB
Python
225 lines
7.3 KiB
Python
from pathlib import Path
|
|
|
|
|
|
def write_readme_only_repo(root: Path) -> Path:
|
|
repo = root / "readme-only"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text(
|
|
"# Readme Only\n\nThis repository describes a planned interface.\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_python_cli_repo(root: Path) -> Path:
|
|
repo = root / "python-cli"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text("# Python CLI\n", encoding="utf-8")
|
|
(repo / "requirements.txt").write_text("click\npytest\n", encoding="utf-8")
|
|
(repo / "cli.py").write_text(
|
|
"import click\n\n"
|
|
"@click.command()\n"
|
|
"def main():\n"
|
|
" click.echo('ok')\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "tests").mkdir()
|
|
(repo / "tests" / "test_cli.py").write_text(
|
|
"def test_cli(): pass\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_misleading_docs_repo(root: Path) -> Path:
|
|
repo = root / "misleading-docs"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text(
|
|
"# Misleading Docs\n\nClaims to provide payments and search, but has no code.\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_javascript_typescript_package_repo(root: Path) -> Path:
|
|
repo = root / "js-ts-package"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text(
|
|
"# JS TS Package\n\nExposes browser and API package code.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "package.json").write_text(
|
|
'{"dependencies":{"react":"latest","vite":"latest"},'
|
|
'"devDependencies":{"vitest":"latest"}}',
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "src").mkdir()
|
|
(repo / "src" / "api").mkdir()
|
|
(repo / "src" / "api" / "routes.ts").write_text(
|
|
"export function routeRequest(input: Request): Response {\n"
|
|
" return new Response('ok')\n"
|
|
"}\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "src" / "api" / "routes.spec.ts").write_text(
|
|
"import { describe, it } from 'vitest'\n"
|
|
"describe('routes', () => { it('works', () => {}) })\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_empty_repo(root: Path) -> Path:
|
|
repo = root / "empty-repo"
|
|
repo.mkdir()
|
|
return repo
|
|
|
|
|
|
def write_key_cape_like_repo(root: Path) -> Path:
|
|
repo = root / "key-cape-like"
|
|
repo.mkdir()
|
|
(repo / "INTENT.md").write_text(
|
|
"# INTENT\n\n"
|
|
"Provide lightweight IAM profile enforcement for small deployments.\n\n"
|
|
"## Intended Capabilities\n\n"
|
|
"- Enforce OIDC PKCE profiles.\n"
|
|
"- Validate LDAP schema migrations.\n"
|
|
"- Run migration tooling for identity data.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "SCOPE.md").write_text(
|
|
"# SCOPE\n\n"
|
|
"Old polluted scope mentions routing LLM provider requests.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "README.md").write_text(
|
|
"# KeyCape\n\n"
|
|
"Lightweight IAM service with OIDC profile enforcement and LDAP schema "
|
|
"validation. Backend adapters live under src/internal/adapters.\n"
|
|
"See CLAUDE.md for agent workflow.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "CLAUDE.md").write_text(
|
|
"# CLAUDE.md\n\n"
|
|
"Guidance for Claude Code when working in this repository.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "src" / "internal" / "adapters").mkdir(parents=True)
|
|
(repo / "src" / "internal" / "adapters" / "oidc.py").write_text(
|
|
"def enforce_pkce_profile(client):\n"
|
|
" return client.require_pkce\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_llm_connect_like_repo(root: Path) -> Path:
|
|
repo = root / "llm-connect-like"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text(
|
|
"# LLM Connect\n\nSupports OpenRouter and Claude fallback for prompts.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / ".env.example").write_text(
|
|
"OPENROUTER_API_KEY=\nANTHROPIC_API_KEY=\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "providers.py").write_text(
|
|
"provider_registry = {'openrouter': OpenRouterAdapter, 'anthropic': ClaudeAdapter}\n"
|
|
"fallback_provider = 'claude'\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_facade_repo(root: Path) -> Path:
|
|
repo = root / "facade-repo"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text(
|
|
"# Mail Facade\n\n"
|
|
"Provides a public HTTP facade that wraps the upstream mail classifier.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "app.py").write_text(
|
|
"from fastapi import FastAPI\n"
|
|
"app = FastAPI()\n"
|
|
'@app.post("/classify")\n'
|
|
"def classify():\n"
|
|
" return {}\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_dependency_only_repo(root: Path) -> Path:
|
|
repo = root / "dependency-only"
|
|
repo.mkdir()
|
|
(repo / "README.md").write_text(
|
|
"# Dependency Only\n\nUses OpenRouter during experiments but exposes no API.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "requirements.txt").write_text(
|
|
"openai\nanthropic\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|
|
|
|
|
|
def write_ops_bridge_like_repo(root: Path) -> Path:
|
|
repo = root / "ops-bridge-like"
|
|
repo.mkdir()
|
|
(repo / "INTENT.md").write_text(
|
|
"# INTENT\n\n"
|
|
"## Purpose\n\n"
|
|
"This repository exists to provide a **reliable, inspectable, and controllable "
|
|
"connectivity layer** between distributed dev, build, test and execution "
|
|
"environments for dev and ops personal human and agentic.\n\n"
|
|
"## Primary Utility\n\n"
|
|
"The repository provides a **managed SSH reverse tunneling system** that:\n\n"
|
|
"* Maintains continuous connectivity between remote systems and a central hub\n"
|
|
"* Makes connectivity **observable, auditable, and controllable**\n"
|
|
"* Exposes this capability as both a **CLI tool and an MCP-accessible service**\n\n"
|
|
"## Intended Users\n\n"
|
|
"* Human operators managing infrastructure and connectivity\n"
|
|
"* LLM-based agents requiring stable access to local services\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "SCOPE.md").write_text(
|
|
"# SCOPE\n\nSSH reverse tunnel lifecycle manager for remote execution environments.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "README.txt").write_text(
|
|
"# Ops Bridge\n\n"
|
|
"Manages named SSH reverse tunnels with auto-reconnect, health checks, "
|
|
"audit logging, and an MCP server so Claude Code can start and inspect tunnels.\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "pyproject.toml").write_text(
|
|
"[project]\ndependencies = ['typer', 'pytest']\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "scripts").mkdir()
|
|
(repo / "scripts" / "register_mcp.py").write_text(
|
|
'"""Register the ops-bridge MCP server with Claude MCP."""\n'
|
|
"from pathlib import Path\n"
|
|
"CLAUDE_JSON = Path.home() / '.claude.json'\n"
|
|
"def main():\n"
|
|
" return CLAUDE_JSON.exists()\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "bridge").mkdir()
|
|
(repo / "bridge" / "cli.py").write_text(
|
|
"import typer\n"
|
|
"app = typer.Typer()\n"
|
|
"@app.command()\n"
|
|
"def up(name: str):\n"
|
|
" return name\n",
|
|
encoding="utf-8",
|
|
)
|
|
(repo / "workplans").mkdir()
|
|
(repo / "workplans" / "BRIDGE-WP-0003.md").write_text(
|
|
"# MCP skill work\n\nClaude Code sessions can call bridge_status().\n",
|
|
encoding="utf-8",
|
|
)
|
|
return repo
|