Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions BOOTSTRAP_MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
"generated MSBuild/C# package metadata has synchronization checks",
"cross-platform net48 reference assemblies are explicit and private",
"local preflight validates WSL/config/Valheim/BepInEx/Jotunn state",
"Bash and OMP deployment share metadata-driven scripts/deploy.py",
"canonical Bash/Python deployment is shared by optional agent adapters",
"development deployment removes stale suite DLLs and enforces side membership",
"OMP inspection is confined to Valheim Managed assemblies",
"OMP server logs no longer run arbitrary configured commands",
"the optional OMP adapter confines assembly inspection to Valheim Managed assemblies",
"the optional OMP adapter delegates server logs/status to fixed canonical runtime operations",
"deterministic local Release packages and SHA256SUMS are implemented",
"scaffold regression tests protect established architecture",
"generic bootstrap/template/tests separation replaces the single-instance scaffold",
"generated public-release metadata requires a selected root license and removal of LICENSE.todo"
],
"runtimeVerificationStillRequired": [
"full plugin build in a generated project's WSL/Valheim environment",
"OMP extension load against the user installed OMP package",
"optional agent-adapter loading when an adapter is enabled",
"dedicated-server plugin load",
"multiplayer compatibility matrix",
"Shared Diagnostics CustomRPC",
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ Or non-interactively:
`ServerCore`, `Client`, and `Shared.Diagnostics` can each be omitted when they
are not needed.

Portable coding-agent support is included by default using `AGENTS.md`,
`.context/`, and standard project skills under `.agents/skills/`. It is not
tied to a specific agent provider or harness.

Use `--no-agent-tooling` to generate a project without that layer. Optional
provider-specific integrations are additive adapters; for example,
`--agent-adapter omp` adds the OMP extension and prompt without replacing the
portable project instructions or skills.

After generation:

```bash
Expand Down
23 changes: 22 additions & 1 deletion bootstrap/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pathlib import Path

from . import naming
from .model import ProjectModel, ProjectParams, build_model, identity_lock_dict, solution_text, suite_config_dict, validate_params
from .model import AGENT_ADAPTERS, ProjectModel, ProjectParams, build_model, identity_lock_dict, solution_text, suite_config_dict, validate_params
from .render import TEMPLATE_DIR, render_tree, validate_template
from .validate_generated import NO_BYTECODE_ENV, ValidationResult, validate_generated

Expand Down Expand Up @@ -62,6 +62,14 @@ def interactive_params() -> tuple[ProjectParams, str]:
include_server_core = _prompt_yes_no("Include ServerCore?")
include_client = _prompt_yes_no("Include Client?")
include_shared_diagnostics = _prompt_yes_no("Include Shared.Diagnostics?")
include_agent_tooling = _prompt_yes_no("Include portable agent tooling?", default=True)
agent_adapters: tuple[str, ...] = ()
if include_agent_tooling:
agent_adapters = tuple(
adapter
for adapter in sorted(AGENT_ADAPTERS)
if _prompt_yes_no(f"Include {adapter.upper()} agent adapter?", default=False)
)
params = ProjectParams(
suite_name=suite_name,
root_namespace=root_namespace,
Expand All @@ -72,6 +80,8 @@ def interactive_params() -> tuple[ProjectParams, str]:
include_server_core=include_server_core,
include_client=include_client,
include_shared_diagnostics=include_shared_diagnostics,
include_agent_tooling=include_agent_tooling,
agent_adapters=agent_adapters,
)
return params, output_directory

Expand All @@ -88,6 +98,15 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
parser.add_argument("--no-server-core", action="store_true")
parser.add_argument("--no-client", action="store_true")
parser.add_argument("--no-shared-diagnostics", action="store_true")
parser.add_argument("--no-agent-tooling", action="store_true")
parser.add_argument(
"--agent-adapter",
action="append",
choices=sorted(AGENT_ADAPTERS),
default=[],
metavar="ADAPTER",
help="Add a harness-specific adapter on top of the portable agent tooling; repeatable.",
)
parser.add_argument("--force", action="store_true")
return parser.parse_args(argv)

Expand Down Expand Up @@ -121,6 +140,8 @@ def resolve_params(args: argparse.Namespace) -> tuple[ProjectParams, str]:
include_server_core=not args.no_server_core,
include_client=not args.no_client,
include_shared_diagnostics=not args.no_shared_diagnostics,
include_agent_tooling=not args.no_agent_tooling,
agent_adapters=tuple(args.agent_adapter),
)
return params, args.output

Expand Down
28 changes: 25 additions & 3 deletions bootstrap/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"csharp_language_version": "10",
}

AGENT_ADAPTERS = frozenset({"omp"})


@dataclass(frozen=True)
class ProjectParams:
Expand All @@ -32,6 +34,8 @@ class ProjectParams:
include_server_core: bool = True
include_client: bool = True
include_shared_diagnostics: bool = True
include_agent_tooling: bool = True
agent_adapters: tuple[str, ...] = ()


def validate_params(p: ProjectParams) -> None:
Expand Down Expand Up @@ -113,8 +117,28 @@ def has_client_package(self) -> bool:
contributes because it always reaches the client side too."""
return self.client is not None or self.shared_diagnostics is not None

@property
def has_agent_tooling(self) -> bool:
return self.params.include_agent_tooling

@property
def has_omp_adapter(self) -> bool:
return "omp" in self.params.agent_adapters


def build_model(params: ProjectParams) -> ProjectModel:
unknown_adapters = sorted(set(params.agent_adapters) - AGENT_ADAPTERS)
if unknown_adapters:
raise naming.NamingError(
"unsupported agent adapter(s): " + ", ".join(unknown_adapters)
)
if len(set(params.agent_adapters)) != len(params.agent_adapters):
raise naming.NamingError("agent adapters must not contain duplicates")
if not params.include_agent_tooling and params.agent_adapters:
raise naming.NamingError(
"agent adapters require portable agent tooling; remove --no-agent-tooling "
"or omit the adapter"
)
if not (params.include_server_core or params.include_client or params.include_shared_diagnostics):
raise naming.NamingError(
"at least one runtime module must be enabled: ServerCore, Client, or Shared.Diagnostics "
Expand Down Expand Up @@ -371,7 +395,6 @@ def release_package_family_bullets(model: ProjectModel) -> str:
def pending_runtime_proof_bullets(model: ProjectModel) -> str:
lines = [
"- full Jötunn/Valheim plugin compilation",
"- OMP extension load against the installed OMP package",
"- dedicated-server plugin load",
"- actual multiplayer compatibility behavior",
]
Expand All @@ -385,7 +408,6 @@ def hardening_pending_proof_bullets(model: ProjectModel) -> str:
lines = [
"- full plugin build against the user's actual Valheim/Jötunn installation",
"- Jötunn publicized-reference generation on the user's WSL/Windows setup",
"- OMP extension loading/type compatibility against the installed OMP package",
"- Valheim dedicated-server plugin load",
"- client/server connection matrix",
]
Expand All @@ -405,7 +427,7 @@ def project_spec_milestone2_body(model: ProjectModel) -> str:


def initial_milestones_bullets(model: ProjectModel) -> str:
lines = ["Repository/harness scaffold.", "Runtime plugin shells and side boundaries."]
lines = ["Repository and portable agent-tooling scaffold.", "Runtime plugin shells and side boundaries."]
if model.shared_diagnostics:
lines.append("Shared Diagnostics CustomRPC proof.")
lines.append("First real feature (see `docs/features/TEMPLATE.md`).")
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class TemplateSourceError(OSError):
# `has_server_package`/`has_client_package` model properties that drive
# `packaging/server/README.md`'s and `packaging/client/README.md`'s own content.
OPTIONAL_GROUP_PRESENT = {
"agent_tooling": lambda m: m.has_agent_tooling,
"omp_adapter": lambda m: m.has_omp_adapter,
"server_core": lambda m: m.server_core is not None,
"client": lambda m: m.client is not None,
"shared_diagnostics": lambda m: m.shared_diagnostics is not None,
Expand Down
52 changes: 30 additions & 22 deletions bootstrap/template_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,10 @@
# modules are included.
REQUIRED_TEMPLATE_FILES: frozenset[str] = frozenset(
{
".context/CONTEXT.md",
".context/_meta/schema.md",
".context/_templates/finding.md",
".context/findings/CONTEXT.md",
".context/findings/valheim-runtime.md",
".context/references/CONTEXT.md",
".context/references/architecture.md",
".context/references/networking.md",
".context/references/patching.md",
".context/references/project.md",
".context/references/testing.md",
".context/state/CONTEXT.md",
".context/state/current.md",
".editorconfig",
".env.example",
".gitignore",
".omp/extensions/valheim-dev/README.md",
".omp/extensions/valheim-dev/index.ts",
".omp/prompts/bootstrap-valheim.md",
".omp/skills/harmony-reverse-engineering/SKILL.md",
".omp/skills/valheim-modding/SKILL.md",
".omp/skills/valheim-networking/SKILL.md",
".omp/skills/valheim-release/SKILL.md",
".valheim/dev.json.example",
"AGENTS.md",
"BOOTSTRAP_PROMPT.md",
"CHANGELOG.md",
"Directory.Build.props",
"Directory.Packages.props",
Expand Down Expand Up @@ -113,6 +91,36 @@
# `docs/TEMPLATE_MAINTENANCE.md` for how to add a new optional module or
# optional documentation group.
OPTIONAL_TEMPLATE_FILES: dict[str, frozenset[str]] = {
"agent_tooling": frozenset(
{
".agents/skills/harmony-reverse-engineering/SKILL.md",
".agents/skills/valheim-modding/SKILL.md",
".agents/skills/valheim-networking/SKILL.md",
".agents/skills/valheim-release/SKILL.md",
".context/CONTEXT.md",
".context/_meta/schema.md",
".context/_templates/finding.md",
".context/findings/CONTEXT.md",
".context/findings/valheim-runtime.md",
".context/references/CONTEXT.md",
".context/references/architecture.md",
".context/references/networking.md",
".context/references/patching.md",
".context/references/project.md",
".context/references/testing.md",
".context/state/CONTEXT.md",
".context/state/current.md",
"AGENTS.md",
"BOOTSTRAP_PROMPT.md",
}
),
"omp_adapter": frozenset(
{
".omp/extensions/valheim-dev/README.md",
".omp/extensions/valheim-dev/index.ts",
".omp/prompts/bootstrap-valheim.md",
}
),
"server_core": frozenset(
{
"src/__ROOT_NAMESPACE__.ServerCore/Core/FeatureRegistry.cs",
Expand Down
Loading
Loading