Skip to content

fix: create stub files on init and rename apiVersion to v1alpha1#32

Open
wiliyam wants to merge 1 commit intoagents-oss:mainfrom
wiliyam:fix/init-create-stub-files-and-apiver-20-21
Open

fix: create stub files on init and rename apiVersion to v1alpha1#32
wiliyam wants to merge 1 commit intoagents-oss:mainfrom
wiliyam:fix/init-create-stub-files-and-apiver-20-21

Conversation

@wiliyam
Copy link
Copy Markdown

@wiliyam wiliyam commented Apr 1, 2026

Summary

Fixes #20 and #21

Issue #20 — init stub files

agentspec init generated an agent.yaml referencing $file:prompts/system.md but never created the file, breaking the quick-start flow at the generate step.

Changes:

  • After writing agent.yaml, init now creates prompts/system.md with a sensible default system prompt
  • If --eval was selected, also creates eval/datasets/qa.jsonl stub
  • Skips creation if the file already exists (safe to re-run)

Issue #21 — rename apiVersion

The manifest apiVersion: agentspec.io/v1 signalled a stable API but the schema is still evolving.

Changes:

  • Renamed to agentspec.io/v1alpha1 across all source, test, example, and demo files (39 files)
  • Added backward-compat migration v1ToV1Alpha1 so existing manifests using agentspec.io/v1 are silently upgraded rather than failing validation

Copy link
Copy Markdown
Contributor

@skokaina skokaina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, overall this is a great push, there's a intended migration script that should keep target as v1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an assistant script to help migrate later from v1aplha1 to v1

migrate(raw: Record<string, unknown>): Record<string, unknown> {
return {
...raw,
apiVersion: 'agentspec.io/v1',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remain v1

*/
export const v1alpha1ToV1: Migration = {
from: 'agentspec/v1alpha1',
to: 'agentspec.io/v1',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remain v1

const migrations: Migration[] = [v1alpha1ToV1]
const migrations: Migration[] = [v1alpha1ToV1, v1ToV1Alpha1]

export const LATEST_API_VERSION = 'agentspec.io/v1'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remain v1 ?

mockIsLatestVersion.mockReturnValue(false)
mockMigrateManifest.mockReturnValue({
result: migratedObj,
migrationsApplied: ['agentspec/v1alpha1 → agentspec.io/v1'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remain v1 as a target, same for others

@iliassjabali
Copy link
Copy Markdown
Collaborator

Hey @wiliyam, this PR has picked up merge conflicts against main. Could you rebase onto the latest main and push the resolution when you get a chance? Once it is clean I will take another pass at reviewing. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agentspec init must create stub files it references

3 participants