12 Matching Annotations
  1. Last 7 days
    1. Best Practices Clear triggers: Define specific conditions for activation Focused scope: Each skill should do one thing well Informative prompts: Give Claude clear instructions Error handling: Account for edge cases in prompts Test thoroughly: Verify skills work across scenarios

      Similar good practices as compared to slashcommands. The first one is new and important: defining the trigger conditions well.

    2. 2. Create skill.json { "name": "test-runner", "description": "Automatically runs relevant tests when code changes", "triggers": { "onFileChange": ["**/*.ts", "**/*.tsx"], "onCommand": "/test" } }

      the json files specifies the triggers for a skill. Which can be a manual command, but also others like file changes. So one could shape any slashcommand as a skill too? To better daisychain them e.g.

    3. Skills are advanced automation capabilities that Claude can invoke automatically based on context. Skills vs Slash Commands FeatureSlash CommandsSkillsInvocationManual (/command)AutomaticTriggerUser types commandContext-basedComplexitySimple promptsScripts + promptsUse caseRepetitive tasksSmart automation

      Comparison w slash commands is a diff in trigger (me typing command or called by AI), simplicity (simple single prompts vs prompts and scripts), use cases (repetitive and smart automation) (repetitive warrants automation too imo)

    1. Include specific files with curly braces: <!-- .claude/commands/optimize.md --> Analyze {src/utils/helpers.ts} for optimization opportunities.

      one can reference outside files in slashcommands. E.g. to rerun test on something (although argument would work too). I see a diff in using a reference files as input, or as object of the command, not explained here though

    2. Single responsibility: Each command should do one thing well

      good practice 1, a single clear thing in a command. This, like similar advices for MCP agents and skills, pushes it to granular level. Meaning you could chain them. Similar usage as deterministic elements in CLI possible I'd say. This makes a command a single function in that sense

    3. Using Arguments Commands can accept arguments via $ARGUMENTS: <!-- .claude/commands/explain.md --> Explain $ARGUMENTS in simple terms. Provide: - What it does - Why it's useful - Example usageCopy to clipboard Usage: /explain the useCallback hook

      slash commands can accepts arguments