revfactory/harness-100/branching-logic
Claude Code and agent skill by revfactory/harness-100
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install revfactory/harness-100/branching-logicSKILL.md
The same SKILL.md was published earlier as revfactory/harness-100/branching-logic.
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)
- 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
- Advantage: High replay value
- Disadvantage: Requires 3x the content
- Suited For: Short games, visual novels
3. Branching Tree
- 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)
- 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
- 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
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:
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
- Every ending must have closure — even a "bad ending" should be narratively complete
- The best ending should not be too easy — rewards proportional to effort
- Hidden endings must have hints — completely blind discovery leads to dissatisfaction
- 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:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingen/05-game-narrative/.claude/skills/branching-logic/skill.md
Popularity
- Repository stars
- 1,328
- Repository forks
- 457
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/revfactory/harness-100/branching-logic)