code-generation-developer
This skill manages code generation tasks for tools like SwiftGen and Sourcery to ensure proper file usage.
Install
mkdir -p .claude/skills/code-generation-developer && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6714" && unzip -o skill.zip -d .claude/skills/code-generation-developer && rm skill.zipInstalls to .claude/skills/code-generation-developer
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Context-aware routing to code generation workflows including SwiftGen, Sourcery, Feature Flags, and Protobuf. Use when running make generate, adding feature flags, or working with generated files.Key capabilities
- →Route tasks to project generators
- →Sync SwiftGen and Sourcery files
- →Maintain feature flag registries
- →Enforce code generation workflows
How it works
Acts as a workflow router that forces the execution of make commands to keep generated source code synchronized.
Inputs & outputs
When to use code-generation-developer
- →Run project-wide code generation
- →Add new feature flags to the codebase
- →Regenerate middleware or protobuf files
- →Update localization assets
About this skill
Code Generation Developer (Smart Router)
Purpose
Context-aware routing to code generation workflows: SwiftGen, Sourcery, Feature Flags, and Protobuf. Helps you navigate when and how to run generators.
When Auto-Activated
- Running or discussing
make generate - Adding feature flags
- Working with generated files
- Keywords: swiftgen, sourcery, feature flags, FeatureFlags, make generate
🚨 CRITICAL RULES (NEVER VIOLATE)
- NEVER edit generated files - Files marked with
// Generated using Sourcery/SwiftGenare auto-generated - ALWAYS run
make generateafter changes - When updating templates, flags, assets, or localization - Feature flags for all new features - Wrap experimental code for safe rollouts
- Update source, not generated code - Edit templates/configurations, then regenerate
📋 Essential Commands
make generate # Run all generators (SwiftGen, Sourcery, assets, localization)
make generate-middle # Regenerate middleware and protobuf (when dependencies change)
make setup-middle # Initial middleware setup
🚩 Feature Flags Quick Workflow
1. Define Flag
File: /Modules/AnytypeCore/AnytypeCore/Utils/FeatureFlags/FeatureDescription+Flags.swift
extension FeatureDescription {
static let newChatInterface = FeatureDescription(
title: "New Chat Interface",
type: .feature(author: "Your Name", releaseVersion: "0.42.0"),
defaultValue: false, // Off in production
debugValue: true // On in debug builds for testing
)
}
2. Generate
make generate
This creates: Modules/AnytypeCore/AnytypeCore/Generated/FeatureFlags.swift
3. Use in Code
import AnytypeCore
if FeatureFlags.newChatInterface {
NewChatView()
} else {
LegacyChatView()
}
Flag Types
.debug: Debug-only (not available in production).feature(author:releaseVersion:): Production feature with metadata
Best Practices
defaultValue: falsefor unreleased featuresdebugValue: truefor easier developer testing- Remove flags after full rollout
🎯 When to Run make generate
| You Did This | Run This | Why |
|---|---|---|
| Added/updated .xcstrings | make generate | Regenerate Loc constants |
| Added feature flag | make generate | Generate FeatureFlags enum |
| Added icon to Assets.xcassets | make generate | Generate Image asset constants |
| Modified Sourcery template | make generate | Regenerate code from templates |
| Updated middleware version | make generate-middle | Regenerate protobuf bindings |
🎨 SwiftGen - Assets & Localization
Adding Icons
- Export SVG from Figma (e.g., "32/qr code" →
QRCode.svg) - Add to
/Modules/Assets/.../Assets.xcassets/DesignSystem/x32/QRCode.imageset/ - Run
make generate - Use:
Image(asset: .X32.qrCode)
Icon Sizes: x18, x24, x32, x40 (pt)
Localization
SwiftGen generates Loc constants from .xcstrings files.
See localization-developer skill for complete workflow.
🔧 Sourcery - Template-Based Generation
Sourcery generates Swift code from templates based on source file annotations.
Common uses:
- Protocol conformance
- Mock implementations
- Dependency injection
- Enum helpers
Workflow:
- Add annotation to source file:
// sourcery: AutoEquatable - Run
make generate - Use generated code (don't edit generated files!)
🔌 Middleware & Protobuf
When to Regenerate
- Middleware version updated
Dependencies/Middleware/Lib.xcframeworkmissing binaries- Build errors related to middleware symbols
Commands
make setup-middle # Initial setup
make generate-middle # Regenerate middleware + protobuf
⚠️ Common Mistakes
Editing Generated Files
// In FeatureFlags.swift (GENERATED)
static let myFlag: Bool = true // ❌ DON'T DO THIS
// Your changes will be overwritten
✅ Correct: Edit FeatureDescription+Flags.swift, then make generate
Forgetting to Generate
// Added FeatureDescription but didn't generate
if FeatureFlags.myNewFlag { // ❌ Error: unresolved identifier
...
}
✅ Correct: Run make generate first
Missing Middleware Binaries
Symptoms: "Lib.xcframework missing binaries"
Solution: make setup-middle or make generate
📚 Complete Documentation
Full Guide: Modules/AnytypeCore/CODE_GENERATION_GUIDE.md
For comprehensive coverage of:
- Feature Flags lifecycle (Development → Beta → Rollout → Cleanup)
- SwiftGen configuration files and workflows
- Sourcery templates and annotations
- Protobuf splitting configuration
- Complete troubleshooting guide
- Generated file locations
✅ Checklist: Before Committing
- Ran
make generateif you added/updated:- Feature flags
- Icons/assets
- Localization strings
- Sourcery annotations
- Did NOT manually edit files with "// Generated using" header
- Committed both source AND generated files
- Verified build succeeds
🔗 Related Skills & Docs
- localization-developer →
LOCALIZATION_GUIDE.md- Localization keys generated by SwiftGen - ios-dev-guidelines →
IOS_DEVELOPMENT_GUIDE.md- Never edit generated files - design-system-developer → Icons generated by SwiftGen
Navigation: This is a smart router. For deep technical details, always refer to CODE_GENERATION_GUIDE.md.
When not to use it
- →Editing generated files directly
- →Manually updating localization assets
Prerequisites
Limitations
- →Requires strict adherence to build system rules
- →Dependencies like Sourcery must be locally available
How it compares
It acts as a procedural gatekeeper ensuring manual edits never overwrite autogenerated logic.
Compared to similar skills
code-generation-developer side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| code-generation-developer (this skill) | 1 | 6mo | Review | Intermediate |
| command-development | 16 | 9mo | Review | Intermediate |
| skill-forge | 11 | 9mo | Review | Intermediate |
| codex-skill | 12 | 5mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by anyproto
View all by anyproto →You might also like
command-development
anthropics
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
skill-forge
WilliamSaysX
Automated skill creation workshop with intelligent source detection, smart path management, and end-to-end workflow automation. This skill should be used when users want to create a new skill or convert external resources (GitHub repositories, online documentation, or local directories) into a skill. Automatically fetches, organizes, and packages skills with proactive cleanup management.
codex-skill
feiskyer
Use when user asks to leverage codex, gpt-5, or gpt-5.1 to implement something (usually implement a plan or feature designed by Claude). Provides non-interactive automation mode for hands-off task execution without approval prompts.
agent-factory
alirezarezvani
Claude Code agent generation system that creates custom agents and sub-agents with enhanced YAML frontmatter, tool access patterns, and MCP integration support following proven production patterns
subagent-driven-development
davila7
Use when executing implementation plans with independent tasks in the current session
peekaboo
openclaw
Capture and automate macOS UI with the Peekaboo CLI.