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
21 changes: 21 additions & 0 deletions daggie/src/daggie/prompts/system_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ My module description here.
"""My module description here."""
```

### Type Naming (Avoiding Redundancy on Daggerverse)
Dagger automatically prefixes secondary type names with the module name on daggerverse.dev. Only the **main class** keeps its name as-is. To avoid redundant names like `GcpCloudRunCloudRunService`, use short, unprefixed names for secondary types:

```python
# Module: gcp-cloud-run

# GOOD — appears as "GcpCloudRunService" on daggerverse
@object_type
class Service:
...

# BAD — appears as "GcpCloudRunCloudRunService" on daggerverse
@object_type
class CloudRunService:
...
```

The same rule applies across all SDKs (Go structs, TypeScript classes). The main class name should match the module (e.g., `GcpCloudRun` for `gcp-cloud-run`), but secondary types should use short domain names (e.g., `RunService`, `RunJob`, `Chart`).

**WARNING:** Some short names like `Service`, `Container`, `Directory`, `File`, `Secret` are reserved by Dagger core (`daggercore`). Using them causes `type "X" is already defined by module "daggercore"` errors. Add a domain prefix to avoid collisions (e.g., `RunService` instead of `Service`).

### Key Concepts
- **Functions** — exported methods on the main class, exposed as CLI commands
- **Container API** — `dag.container().from_()`, `.with_exec()`, `.with_mounted_directory()`, `.with_env_variable()`
Expand Down
12 changes: 6 additions & 6 deletions gcp-cloud-run/src/gcp_cloud_run/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _validate_positive_int(value: int, field: str) -> int:


@object_type
class CloudRunService:
class RunService:
"""Cloud Run service operations."""

@function
Expand Down Expand Up @@ -282,7 +282,7 @@ async def get_logs(


@object_type
class CloudRunJob:
class RunJob:
"""Cloud Run job operations."""

@function
Expand Down Expand Up @@ -402,11 +402,11 @@ class GcpCloudRun:
"""Google Cloud Run deployment utilities."""

@function
def service(self) -> CloudRunService:
def service(self) -> RunService:
"""Access Cloud Run service operations."""
return CloudRunService()
return RunService()

@function
def job(self) -> CloudRunJob:
def job(self) -> RunJob:
"""Access Cloud Run job operations."""
return CloudRunJob()
return RunJob()