Code Generation Developer (Smart Router)

Routes development tasks to correct code-generation workflows for SwiftGen, Sourcery, and Protobuf.

509|79|Updated May 26, 2023
One-click install
npx skills add https://github.com/anyproto/anytype-swift --skill code-generation-developer-smart-router
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Code Generation Developer (Smart Router)
Source: https://github.com/anyproto/anytype-swift/tree/main/.claude/skills/code-generation-developer
Command: npx skills add https://github.com/anyproto/anytype-swift --skill code-generation-developer-smart-router

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually managing generated code, feature flags, and assets is error-prone and time-consuming, leading to inconsistencies and build failures. This Skill streamlines code generation, ensuring consistency and reducing manual effort.

Core Features & Use Cases

  • Automated Generation Guidance: Guides you on when and how to run make generate for SwiftGen, Sourcery, and Protobuf, preventing missed steps.
  • Feature Flag Management: Simplifies defining, generating, and using feature flags for safe rollouts and easy experimentation.
  • Use Case: After adding a new icon or localization string, activate this Skill to ensure you correctly run make generate and avoid common mistakes like editing generated files or forgetting to regenerate, saving you debugging time.

Quick Start

I've added a new icon to Assets.xcassets. Guide me through the steps to ensure it's correctly integrated into the codebase.

Frequently Asked Questions about Code Generation Developer (Smart Router)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I regenerate code after adding new assets or localization strings?

Run `make generate` to automatically regenerate code for SwiftGen, Sourcery, and Protobuf. This ensures new icons, strings, and assets are correctly integrated into your codebase and prevents inconsistencies from manual edits.

Why shouldn't I edit generated files directly?

Generated files are overwritten each time you run `make generate`. Editing them directly causes your changes to be lost, leading to bugs and maintenance headaches. Always modify templates and configurations instead.

How do I add feature flags for safe feature rollouts?

Define feature flags in your configuration, then run `make generate` to create the flag definitions. Use generated flag constants in your code for type-safe rollouts and easy experimentation without manual flag management.

What's the correct workflow when I add a new icon to Assets.xcassets?

After adding the icon, run `make generate` to regenerate SwiftGen code. This automatically creates type-safe constants for the new asset, making it accessible throughout your codebase without manual updates.

Does this support Protobuf alongside SwiftGen and Sourcery?

Yes. This routes generation tasks to SwiftGen, Sourcery, Protobuf, and feature flag workflows. You can manage all code generation from a single `make generate` command, ensuring consistency across different asset types.

When should I regenerate middleware and localization assets?

Regenerate after modifying templates, configuration files, or source data for middleware and localization. Running `make generate` ensures all dependent generated files stay synchronized with your latest changes.