skills/cesaraugustusgrob/combat-system-creator/SKILL.md
Create and modify combat system components for SHINOBI WAY game following the dual-system architecture (CombatCalculationSystem + CombatWorkflowSystem). Use when user wants to add new combat mechanics, damage formulas, status effects, mitigation logic, turn phases, or refactor existing combat code. Guides through proper separation of pure calculations vs state management.
npx skillsauth add aiskillstore/marketplace combat-system-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create combat system components following the dual-system architecture: pure calculations separated from state workflow.
Player Action → CombatCalculationSystem (pure math) → CombatWorkflowSystem (apply to state)
CombatCalculationSystem: Pure functions, no mutations, returns complete results CombatWorkflowSystem: State management, applies calculated results, controls flow
1. Hit Check → MELEE: Speed vs Speed | RANGED: Accuracy vs Speed | AUTO: Always hits
2. Base Damage → ScalingStat × damageMult
3. Element → Super: 1.5× (+10% crit) | Resist: 0.5× | Neutral: 1.0×
4. Critical → 8% + (DEX × 0.5) + bonuses, max 75%, multiplier 1.75×
5. Defense → Flat (max 60% reduction) then % (soft cap 75%)
1. INVULNERABILITY → Blocks ALL damage (return 0)
2. REFLECTION → Calculate reflected damage (before curse)
3. CURSE → Amplify: damage × (1 + curseValue)
4. SHIELD → Absorb damage before HP
5. GUTS → Survive at 1 HP if roll succeeds
| Type | Flat | Percent (Soft Cap) |
|------|------|-------------------|
| Physical | STR × 0.3 | STR / (STR + 200) |
| Elemental | SPI × 0.3 | SPI / (SPI + 200) |
| Mental | CAL × 0.25 | CAL / (CAL + 150) |
| Property | Flat Def | % Def | |----------|----------|-------| | NORMAL | ✅ (max 60%) | ✅ | | PIERCING | ❌ | ✅ | | ARMOR_BREAK | ✅ | ❌ | | TRUE | ❌ | ❌ |
Ask: Is this pure math or state management?
| CombatCalculationSystem | CombatWorkflowSystem | |------------------------|---------------------| | Damage formulas | Applying damage to HP | | Hit/miss/evasion rolls | Turn order management | | Crit calculations | Buff duration tracking | | Defense reduction | Phase transitions | | Effect chance rolls | Combat log generation |
For new calculations, define the result interface:
interface NewMechanicResult {
// All values needed to apply this mechanic
value: number;
triggered: boolean;
// Metadata for logging
logs: CombatLogEntry[];
}
// In CombatCalculationSystem
function calculateNewMechanic(
attackerStats: DerivedStats,
defenderStats: DerivedStats,
context: CombatContext
): NewMechanicResult {
// Pure calculation - NO state mutation
return { value, triggered, logs };
}
// In CombatWorkflowSystem
function applyNewMechanic(
state: CombatWorkflowState,
result: NewMechanicResult
): CombatWorkflowState {
// Apply result to state - returns NEW state
return { ...state, /* updated values */ };
}
// Damage Over Time
DOT, BLEED, BURN, POISON
// Crowd Control
STUN, CONFUSION, SILENCE
// Defensive
SHIELD, INVULNERABILITY, REFLECTION
// Stat Modifiers
BUFF, DEBUFF, CURSE
// Recovery
HEAL, REGEN, CHAKRA_DRAIN
interface SkillEffect {
type: EffectType;
value: number; // Damage/heal amount or multiplier
duration: number; // Turns (-1 = permanent)
chance: number; // 0.0-1.0 application chance
targetStat?: PrimaryStat; // For BUFF/DEBUFF
damageType?: DamageType; // For DoTs
damageProperty?: DamageProperty;
}
// DoTs get 50% defense mitigation
dotDamage = max(1, baseDamage - (flatDef × 0.5) - (damage × percentDef × 0.5))
Player Turn:
Enemy Turn:
// 1. Add to CombatPhase enum
enum CombatPhase {
// ... existing
NEW_PHASE,
}
// 2. Create calculation function
function calculateNewPhaseEffects(state: CombatWorkflowState): NewPhaseResult;
// 3. Create workflow handler
function processNewPhase(state: CombatWorkflowState): CombatWorkflowState;
// 4. Insert into turn flow in processEnemyTurn or executePlayerAction
/**
* [Description of what this calculates]
* @param attackerStats - Attacker's derived stats
* @param defenderStats - Defender's derived stats
* @param skill - The skill being used
* @returns [ResultType] with all calculation details
*/
export function calculateX(
attackerStats: DerivedStats,
defenderStats: DerivedStats,
skill: Skill
): XResult {
const result: XResult = {
// Initialize result object
};
// Pure calculations here
// NO state mutation
// Use Math.random() for rolls
return result;
}
/**
* [Description of what state changes this applies]
* @param state - Current combat state
* @param result - Calculation result to apply
* @returns New combat state with changes applied
*/
export function applyX(
state: CombatWorkflowState,
result: XResult
): CombatWorkflowState {
// Create new state object (immutable)
const newState = { ...state };
// Apply result values to state
// Add combat logs
// Check for combat end conditions
return newState;
}
// In constants/index.ts - Add to SKILLS
NEW_SKILL: {
id: 'new_skill',
name: 'New Skill Name',
// ... other properties
effects: [{
type: EffectType.NEW_EFFECT,
value: 10,
duration: 3,
chance: 0.8,
damageType: DamageType.PHYSICAL,
damageProperty: DamageProperty.NORMAL
}]
}
// In CombatSystem.ts - Handle in applyMitigation or processDoT
if (buff.effect.type === EffectType.NEW_EFFECT) {
// Calculate effect
// Apply to appropriate target
}
50 + (WIL × 12)30 + (CHA × 8)maxHP × 0.02 × (WIL / 20)INT × 2WIL / (WIL + 200)CAL / (CAL + 80)SPD / (SPD + 250)development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.