Skip to content

Add /generate-output-schema command#23

Merged
vystrcild merged 3 commits intomainfrom
output-schema-skills
Mar 20, 2026
Merged

Add /generate-output-schema command#23
vystrcild merged 3 commits intomainfrom
output-schema-skills

Conversation

@patrikbraborec
Copy link
Copy Markdown
Collaborator

@patrikbraborec patrikbraborec commented Feb 27, 2026

Summary

  • Adds a new /generate-output-schema slash command that analyzes Actor source code and generates dataset_schema.json, output_schema.json, key_value_store_schema.json (if applicable), and updates actor.json
  • The command follows a 7-phase workflow: discover Actor structure, generate dataset schema, generate key-value store schema, generate output schema, update actor.json, review/validate, and summarize
  • Includes hard rules for schema correctness (nullable on every field, additionalProperties, anonymized examples, type+nullable co-requirement)

How to test before merge

Option 1: Load the plugin locally from the branch

# Clone and checkout the branch
git clone -b output-schema-skills https://github.com/apify/agent-skills.git /tmp/agent-skills-test

# Start Claude Code with the plugin loaded from local directory
claude --plugin-dir /tmp/agent-skills-test

Option 2: If you already have the repo cloned

cd /path/to/agent-skills
git fetch origin output-schema-skills
git checkout output-schema-skills

Run the command in your Actor

Navigate to an Actor project and invoke:

claude --plugin-dir <path>/agent-skills
/apify-agent-skills:generate-output-schema

What to verify

  • The command discovers all pushData / push_data calls and output type definitions
  • The command discovers all setValue / set_value calls for key-value store usage
  • Generates dataset_schema.json with correct field types, nullable: true, additionalProperties: true, and anonymized examples
  • Generates key_value_store_schema.json with collections matching discovered key patterns (if Actor uses KV store)
  • Generates output_schema.json with "type": "string" on every property
  • Updates actor.json with schema file references (including storages.keyValueStore when applicable)
  • Presents schemas for review before writing files

🤖 Generated with Claude Code

patrikbraborec and others added 2 commits February 27, 2026 20:36
…eration

Adds a new slash command that analyzes Actor source code and generates
dataset_schema.json and output_schema.json with proper field definitions,
views, and actor.json wiring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…a command

Adds Phase 3 for generating key_value_store_schema.json by analyzing
Actor.setValue/set_value calls, grouping keys into collections, and
wiring the schema into actor.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address issues found in code reviews (apify-core#26351, facebook#1057):
- Ensure all output fields are in schema, not just overview view fields
- Require `required` and `additionalProperties` on top-level fields object
- Add guidance to reuse existing schemas, types, and conventions in the repo
- Enforce consistent formatting across all actors including standalone ones

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vystrcild vystrcild merged commit 5695c5e into main Mar 20, 2026
2 checks passed
@vystrcild vystrcild deleted the output-schema-skills branch March 20, 2026 09:26
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.

4 participants