branching-logic
A specialized skill for the branch-architect agent covering branching logic. Provides branching structure patterns, flag system design, ending architecture, and state management methodology. Use for 'branch design,' 'multiple endings,' 'flag systems,' 'branching structures,' and similar topics.
Best use case
branching-logic is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
A specialized skill for the branch-architect agent covering branching logic. Provides branching structure patterns, flag system design, ending architecture, and state management methodology. Use for 'branch design,' 'multiple endings,' 'flag systems,' 'branching structures,' and similar topics.
Teams using branching-logic should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/branching-logic/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How branching-logic Compares
| Feature / Agent | branching-logic | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
A specialized skill for the branch-architect agent covering branching logic. Provides branching structure patterns, flag system design, ending architecture, and state management methodology. Use for 'branch design,' 'multiple endings,' 'flag systems,' 'branching structures,' and similar topics.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Branching Logic — Branching Logic Design Methodology
Specialized knowledge used by the branch-architect agent when designing branching structures, endings, and flag systems.
## Why Branching Logic Matters
Branching is the **key differentiator** that separates game narrative from novels and film. However, the more branches there are, the more production costs increase exponentially. The art lies in making players feel significant variation with fewer branches.
## 6 Branching Structure Patterns
### 1. Bottleneck Structure (Hub-and-Spoke)
```
A
/ \
B C <- Branch
\ /
D <- Bottleneck (convergence)
/ \
E F <- Re-branch
\ /
G <- Bottleneck
```
- **Advantage**: Freedom of choice within a feasible production scope
- **Key Point**: All paths converge at bottleneck points, but the **manner of convergence must differ**
- **Suited For**: Most commercial RPGs (The Witcher 3, Mass Effect)
### 2. Parallel Paths
```
A -> B -> C -> D (Route 1)
A -> E -> F -> D (Route 2)
A -> G -> H -> D (Route 3)
```
- **Advantage**: High replay value
- **Disadvantage**: Requires 3x the content
- **Suited For**: Short games, visual novels
### 3. Branching Tree
```
A
/|\
B C D
/| |\
E F G H
```
- **Advantage**: Intuitive, easy to design
- **Disadvantage**: Ending count explosion (2^n), sparse late-game content
- **Suited For**: Short interactive fiction
### 4. Folding Structure (Delayed Consequences)
```
Choice Moment ... Result Manifestation
Choice at A -> Passes through B, C, D -> Result appears at E
```
- **Advantage**: Big impact with few branches, "my choice mattered" feeling
- **Key Point**: Set a flag and trigger it much later
- **Suited For**: Long RPGs, episodic games
### 5. State Accumulation Structure
```
Choice 1: Honor +10 / Infamy +10
Choice 2: Honor +5 / Infamy +5
...
At threshold: Ending A (Honor 70+) / B (Infamy 70+) / C (Neutral)
```
- **Advantage**: The **sum of actions** determines the outcome, not a single choice
- **Key Point**: Players naturally accumulate their tendencies
- **Suited For**: RPGs with morality systems (inFamous, Fable)
### 6. Hybrid Structure
Real games **combine** the above patterns:
- **Main Story**: Bottleneck structure (controllable)
- **Sub Quests**: Branching tree (independent, short)
- **Relationship System**: State accumulation (NPC affinity)
- **Key Choices**: Folding (delayed consequences)
## Flag System Design
### Flag Naming Convention
```
[Category]_[Subject]_[State]
Examples:
QUEST_bandit_camp_destroyed — Quest-related
REL_npc_aria_friendship_high — Relationship-related
WORLD_bridge_repaired — World state
PLAYER_has_ancient_sword — Player possession
STORY_chapter2_twist_revealed — Story progression
MORAL_saved_village — Moral choice
```
### Flag Types
| Type | Value Format | Usage | Example |
|------|-------------|-------|---------|
| **Boolean** | true/false | Event occurrence | `QUEST_dragon_slain = true` |
| **Counter** | Integer | Cumulative actions | `MORAL_mercy_count = 3` |
| **Enum** | String | Path selection | `FACTION_chosen = "rebels"` |
| **Timestamp** | Game time | Time-limited quests | `QUEST_deadline = day_30` |
### Flag Dependency Matrix
Manage all flags needed for branch decisions in a matrix:
```
| Branch Point | Required Flags | Condition | Result |
|-------------|---------------|-----------|--------|
| CH3_Battle | REL_aria >= 50 AND QUEST_sword = true | Met | Aria joins |
| CH3_Battle | REL_aria < 50 OR QUEST_sword = false | Not met | Solo combat |
```
## Ending Architecture
### Ending Classification
| Type | Achievement Condition | Target Player Percentage |
|------|----------------------|------------------------|
| **Standard Ending** | Main quests complete | 70-80% |
| **Best Ending** | Standard + key side quests + max relationships | 15-20% |
| **Worst Ending** | Accumulated critical choices | 5-10% |
| **Hidden Ending** | Special condition combinations | 1-3% |
| **True Ending** | Second playthrough + hidden conditions | 0.5-1% |
### Ending Satisfaction Rules
1. **Every ending must have closure** — even a "bad ending" should be narratively complete
2. **The best ending should not be too easy** — rewards proportional to effort
3. **Hidden endings must have hints** — completely blind discovery leads to dissatisfaction
4. **Post-ending summary**: A "choice results" screen showing the player's key choices and outcomes
## Branch Testing: Path Simulation
Document and verify all possible paths:
```
Path 1 (Path of Justice): A->B->D->F->Best Ending
- Flags: MORAL_good=5, REL_aria=80, QUEST_all_done=true
- Missing Content: None
- Plot Holes: None
Path 2 (Path of Pragmatism): A->C->D->G->Standard Ending
- Flags: MORAL_neutral=3, REL_aria=40
- Missing Content: Aria romance sub-quest
- Plot Holes: Conditional branch needed when Aria is mentioned in CH4
Path 3 (Path of Destruction): A->C->E->H->Worst Ending
- Flags: MORAL_evil=5, REL_aria=-20
- Plot Holes: None
```Related Skills
logical-fallacy-detector
A specialized skill for identifying and correcting logical fallacies in debates. Used by judge and rapporteur agents to evaluate the logical soundness of both sides' arguments and point out errors. Automatically applied in contexts such as 'logical fallacy', 'fallacy detection', 'sophistry', 'argument evaluation', 'logic verification'. However, formal logic theorem proving and mathematical logic verification are outside the scope of this skill.
sustainability-audit
Full audit pipeline for ESG/sustainability where an agent team collaborates to generate environmental, social, and governance assessments along with an integrated report and improvement plan. Use this skill for requests such as 'run an ESG audit', 'write a sustainability report', 'ESG assessment', 'carbon emissions calculation', 'ESG rating diagnosis', 'governance review', 'social responsibility assessment', 'GRI report', 'TCFD disclosure', 'ESG improvement plan', and other ESG/sustainability tasks. Also supports assessment of specific pillars (E/S/G) only or improving existing reports. However, actual on-site audit execution, third-party verification certificate issuance, ESG rating agency score changes, and carbon credit trading are outside the scope of this skill.
materiality-assessment
ESG materiality assessment matrix. Referenced by the esg-reporter and improvement-planner agents when evaluating ESG issue materiality and setting priorities. Use for 'materiality assessment', 'importance analysis', or 'Materiality Matrix' requests. Stakeholder surveys and external certification are out of scope.
ghg-protocol
GHG Protocol detailed guide. Referenced by the environmental-analyst agent when calculating and reporting greenhouse gas emissions. Use for 'GHG Protocol', 'carbon emissions', 'Scope 1/2/3', or 'carbon footprint' requests. Carbon credit trading and CDM project execution are out of scope.
citation-standards
Academic citation and reference standards guide. Referenced by the paper-writer and submission-preparer agents when composing citations and references. Use for 'citation format', 'APA', or 'references' requests. Original paper retrieval and professional database access are out of scope.
academic-paper
Full research pipeline for academic paper writing where an agent team collaborates to generate research design, experiment protocols, analysis, manuscript writing, and submission preparation. Use this skill for requests such as 'write an academic paper', 'research paper writing', 'help me write a paper', 'design a study', 'run statistical analysis', 'prepare journal submission', 'manuscript writing', 'research methodology design', 'hypothesis testing', 'academic writing', and other academic research paper tasks. Also supports analysis, rewriting, and submission preparation when existing data or drafts are available. However, actual data collection execution, official IRB submission, journal system login and upload, and running actual statistical software are outside the scope of this skill.
product-copy-formulas
Product copy formula library. Referenced by the detail-page-writer and marketing-manager agents when writing purchase-driving copy. Use for 'product copy', 'marketing copy', or 'ad copy' requests. Ad placement and design mockup creation are out of scope.
ecommerce-launcher
Full launch pipeline for e-commerce products where an agent team collaborates to generate product planning, detail pages, pricing strategy, marketing, and CS setup all at once. Use this skill for requests such as 'launch an e-commerce product', 'prepare a product launch', 'register a product on Naver Smart Store', 'launch on Coupang', 'create a detail page', 'develop a pricing strategy', 'create a marketing plan', 'launch prep', 'product planning brief', 'e-commerce CS manual', and other e-commerce product launch tasks. Also supports supplementing pricing/marketing/CS even when existing briefs or detail pages are provided. However, actual platform API integration (automated product registration), payment system development, logistics system integration, and real-time order management are outside the scope of this skill.
conversion-optimization
Purchase conversion optimization framework. Referenced by the detail-page-writer and pricing-strategist agents when designing detail pages and pricing with a conversion focus. Use for 'conversion rate optimization', 'CRO', or 'purchase psychology' requests. A/B testing tool setup and funnel automation are out of scope.
real-estate-analyst
Real estate investment analysis pipeline. An agent team collaborates to produce market research, location analysis, profitability analysis, risk assessment, and investment reports. Use this skill for requests such as 'analyze this real estate', 'apartment investment analysis', 'studio apartment yield', 'real estate market research', 'location analysis', 'real estate investment report', 'buy vs lease', 'reconstruction investment analysis', 'commercial property yield analysis', and other general real estate investment analysis tasks. Actual purchase contracts, brokerage services, interior design, and property management are outside the scope of this skill.
location-scoring
Location scoring scorecard. Referenced by the location-analyst agent for systematic real estate location evaluation. Use for requests involving 'location analysis', 'location assessment', or 'commercial area analysis'. On-site inspections and surveying are out of scope.
cap-rate-calculator
Real estate yield calculator. Reference formulas and models used by the profitability-analyst agent for quantitative investment return analysis. Use for requests involving 'Cap Rate', 'yield analysis', 'DCF', or 'cash flow analysis'. Tax advisory and loan underwriting are out of scope.