Writing & LiteratureSkill Writing300 lines
Managing Skill Dependencies
Quick Summary18 lines
Skills rarely exist in complete isolation. A skill about deploying a Next.js app implicitly depends on knowledge of Node.js, Docker, and cloud platforms. Managing these dependencies — making them explicit, minimizing them where possible, and handling them gracefully — determines whether a skill pack feels cohesive or frustrating. This skill covers identifying, documenting, and managing inter-skill dependencies. ## Key Points - JavaScript fundamentals (variables, functions, async/await) - React component basics (JSX, props, rendering) - "React Fundamentals" — for component lifecycle understanding - "TypeScript Basics" — if using TypeScript (optional) - Node.js 20+ installed - npm or yarn package manager - A React project initialized (Create React App or Vite) - Code editor with React/JSX support - Browser with React DevTools extension - `useState(initialValue)` — returns [state, setState] - `useEffect(callback, deps)` — runs side effects 1. Include brief context for assumed knowledge
skilldb get skill-writing-skills/skill-dependenciesFull skill: 300 linesPaste into your CLAUDE.md or agent config
Managing Skill Dependencies
Purpose
Skills rarely exist in complete isolation. A skill about deploying a Next.js app implicitly depends on knowledge of Node.js, Docker, and cloud platforms. Managing these dependencies — making them explicit, minimizing them where possible, and handling them gracefully — determines whether a skill pack feels cohesive or frustrating. This skill covers identifying, documenting, and managing inter-skill dependencies.
Types of Dependencies
Dependency Classification
Dependency Types:
┌───────────────────┬──────────────────────────────────────┐
│ Type │ Description │
├───────────────────┼──────────────────────────────────────┤
│ Hard Dependency │ Skill B cannot be followed without │
│ │ first applying Skill A │
│ │ Example: "Deploy to K8s" requires │
│ │ "K8s Cluster Setup" completed first │
├───────────────────┼──────────────────────────────────────┤
│ Soft Dependency │ Skill B is better with Skill A but │
│ │ can be followed independently │
│ │ Example: "API Design" is better with │
│ │ "REST Principles" but workable alone │
├───────────────────┼──────────────────────────────────────┤
│ Knowledge │ Skill B assumes understanding of │
│ Prerequisite │ concepts (not specific skill file) │
│ │ Example: "React Hooks" assumes basic │
│ │ JavaScript and React knowledge │
├───────────────────┼──────────────────────────────────────┤
│ Tool Prerequisite │ Skill B requires specific tools │
│ │ installed/configured │
│ │ Example: "Docker Compose" requires │
│ │ Docker and Docker Compose installed │
├───────────────────┼──────────────────────────────────────┤
│ Complementary │ Skill A and B work better together │
│ │ but neither requires the other │
│ │ Example: "Monitoring" + "Alerting" │
└───────────────────┴──────────────────────────────────────┘
Dependency Direction
Dependency Relationships:
├── Upstream: Skills this skill depends on
│ └── "Before using this skill, you need..."
├── Downstream: Skills that depend on this skill
│ └── "After this skill, you can proceed to..."
├── Peer: Skills at the same level that complement
│ └── "Related skills: ..."
└── External: Non-skill dependencies (tools, services, accounts)
└── "Required tools: Docker, kubectl, AWS CLI"
Dependency Graph Example:
┌──────────────┐
│ JS Basics │
└──────┬───────┘
│ upstream of
▼
┌──────────────┐ ┌──────────────┐
│ React Basics │←───→│ TypeScript │ (peer)
└──────┬───────┘ └──────────────┘
│ upstream of
▼
┌──────────────┐ ┌──────────────┐
│ React Hooks │←───→│ React State │ (peer)
└──────┬───────┘ └──────────────┘
│ upstream of
▼
┌──────────────┐
│ Custom Hooks │
└──────────────┘
Documenting Dependencies
In the Skill File
Document dependencies at the top of the skill, after Purpose:
## Prerequisites
**Knowledge required:**
- JavaScript fundamentals (variables, functions, async/await)
- React component basics (JSX, props, rendering)
**Skills recommended (from this pack):**
- "React Fundamentals" — for component lifecycle understanding
- "TypeScript Basics" — if using TypeScript (optional)
**Tools required:**
- Node.js 20+ installed
- npm or yarn package manager
- A React project initialized (Create React App or Vite)
**Environment:**
- Code editor with React/JSX support
- Browser with React DevTools extension
This format tells the reader (human or AI):
├── What they should already know
├── What other skills to read first (optional)
├── What must be installed
└── What environment to work in
Minimal Context Pattern
The Minimal Context Pattern:
Include just enough prerequisite knowledge IN the skill
to make it self-contained, without duplicating the full
prerequisite skill.
Example (in a "React Custom Hooks" skill):
## Quick Context: Hooks Basics
React hooks are functions that let you use state and
lifecycle features in function components. The two
most fundamental hooks are:
- `useState(initialValue)` — returns [state, setState]
- `useEffect(callback, deps)` — runs side effects
For deeper coverage, see the "React Hooks Patterns" skill.
## Custom Hooks
[... main content of this skill ...]
Benefits of Minimal Context:
├── Skill is usable standalone (doesn't require reading prerequisites)
├── Context is brief (5-10 lines, not a full tutorial)
├── Points to prerequisite for deeper learning
└── Agent has enough context to follow the skill's instructions
Minimizing Dependencies
The Self-Contained Principle
Goal: Each skill should be usable by someone with general
technical knowledge, without requiring them to read other skills.
Strategies:
1. Include brief context for assumed knowledge
└── 3-5 lines summarizing what the reader needs to know
└── Not a full tutorial, just enough to follow along
2. Use common/standard examples
└── Don't reference custom code from another skill
└── Use widely-known patterns (Express app, React component)
3. Provide default configurations
└── Don't say "use the config from the Setup skill"
└── Provide a working default config inline
4. Explain technology choices briefly
└── Don't say "we chose X in the Architecture skill"
└── Say "using X because it provides Y benefit"
5. Make tool prerequisites explicit
└── List exact install commands, don't reference setup guide
Dependency Inversion for Skills
Dependency Inversion: Instead of depending on specific other
skills, depend on interfaces (expected knowledge/state).
COUPLED (depends on specific skill):
"First, complete the 'AWS Account Setup' skill to configure
your AWS credentials."
DECOUPLED (depends on state, not skill):
"Prerequisites: AWS CLI configured with credentials that have
EC2 and S3 permissions. If not set up, run:
aws configure
# Enter your Access Key ID and Secret Access Key"
Why decoupling is better:
├── Skill works even if prerequisite skill doesn't exist
├── Multiple setup paths can satisfy the prerequisite
├── Agent can check the prerequisite state directly
├── Less fragile (renaming a skill doesn't break references)
└── Works across different skill packs
Circular Dependencies
Circular Dependency Detection:
A → B → C → A (circular — none can be "first")
This happens when skills are poorly scoped:
├── Skill A: "React State" references "React Effects"
├── Skill B: "React Effects" references "React State"
└── Which do you read first?
Resolution Strategies:
1. Merge: If two skills circularly reference each other,
they may be one skill split incorrectly.
→ Combine "React State" and "React Effects" into
"React State and Side Effects"
2. Extract: Move shared concepts into a third skill.
→ Create "React Hooks Fundamentals" containing
the concepts both skills need.
→ Both skills depend on fundamentals, not each other.
3. Inline: Copy the needed context from one into the other.
→ "React State" includes a brief "Effects Overview"
section, removing the need to reference the other skill.
4. Order: Break the cycle by choosing a direction.
→ Decide: State is prerequisite for Effects.
→ "React Effects" references "React State"
→ "React State" does NOT reference "React Effects"
→ Instead, "React State" has a "Next Steps" pointing to Effects
Dependency Management at Scale
Dependency Maps
For large skill repositories, maintain a dependency map:
Format (YAML or JSON):
skills:
react-fundamentals:
depends_on: []
knowledge_prereqs: ["javascript", "html"]
tools: ["node", "npm"]
react-hooks-patterns:
depends_on:
- react-fundamentals # soft dependency
knowledge_prereqs: ["javascript", "react-basics"]
tools: ["node", "npm"]
react-server-components:
depends_on:
- react-fundamentals # soft
- react-hooks-patterns # soft
knowledge_prereqs: ["javascript", "react", "http"]
tools: ["node", "npm", "nextjs"]
Use this map to:
├── Detect circular dependencies
├── Identify skills with many dependents (high-impact if broken)
├── Find orphaned skills (no dependencies, nothing depends on them)
├── Plan update order (update upstream skills first)
└── Generate recommended reading paths
Impact Analysis
When updating a skill, check its dependents:
Impact Assessment:
1. Identify all skills that reference the changed skill
2. For each dependent:
a. Does the change affect what the dependent assumes?
b. Does the change invalidate the dependent's instructions?
c. Does the change require the dependent to update?
3. If yes to any: Update dependent or add migration note
Example:
Changing "PostgreSQL Setup" from version 15 to 16:
├── Check: "PostgreSQL Indexing" — references syntax
│ └── Syntax unchanged in v16 → no update needed
├── Check: "PostgreSQL JSON Queries" — uses JSON operators
│ └── New JSON functions in v16 → add note about new options
├── Check: "Database Migration" — references pg_dump format
│ └── pg_dump format changed → UPDATE REQUIRED
└── Action: Update "Database Migration" skill for v16 format
When to Apply This Skill
Use this skill when:
- Planning a new skill pack and mapping inter-skill relationships
- Writing a skill that builds on concepts from other skills
- Reviewing a skill pack for dependency issues
- Debugging why a skill is hard to follow (hidden prerequisites)
- Refactoring skills to reduce coupling between them
- Deciding whether to merge, split, or restructure skills
Install this skill directly: skilldb add skill-writing-skills