YouTip LogoYouTip

Skills Params

Skills don't receive explicit parameters like traditional functions; they perceive input information through Claude's context. Understanding this "implicit parameter passing" mechanism is the key to writing practical Skills. * * * ## How Skills Obtain Parameters When Claude reads a Skill, the entire conversation context becomes this Skill's parameters. This means what the user says, uploaded files, and historical conversation records can all become input sources for the Skill. | Input Source | Example | Description | | --- | --- | --- | | Current User Message | "Help me process this PDF" | Most direct input | | Uploaded Files | User uploaded report.pdf | Passed through path or content | | Historical Conversation | Previously discussed data format | Can be referenced in context | | System Variables | Current date, working directory path | Automatically perceived by Claude | * * * ## Declaring Expected Input in SKILL.md In SKILL.md, you can use natural language to tell Claude what information to extract from the context. The following is a Skill example for processing CSV files, demonstrating how to declare input expectations in instructions: ## Example --- name: csv-analyzer description: Analyze user-uploaded CSV files, output statistical summary. Triggered when user mentions CSV or table data analysis. --- # CSV Analyzer ## Input Requirements Users should provide the following information (retrieved from conversation context): - **File Path**: Path to the uploaded CSV file (located in /mnt/user-data/uploads/) - **Analysis Goal** (Optional): What the user wants to know, like "find null values" or "statistical distribution" - **Output Format** (Optional): Table, chart, or text summary If the above information is not clear, proactively confirm with the user before executing. > The "Input Requirements" in a Skill are for Claude to read. Based on this description, Claude will proactively extract information from the context, or ask the user when information is insufficient. * * * ## Receiving Structured Parameters Through Scripts When a Skill includes Python or Shell scripts, parameters are passed through command-line arguments or standard input. This is exactly the same as how regular scripts handle parameters. ## Example # File Path: scripts/analyze.py import argparse import pandas as pd def main(): # Define command-line arguments parser= argparse.ArgumentParser(description="CSV file analysis script") parser.add_argument("file",help="Required: CSV file path") parser.add_argument("--col",help="Optional: Column name to analyze") parser.add_argument("--limit",type=int, default=10, help="Optional: Maximum number of rows to display, default 10") args =parser.parse_args() # Read file df = pd.read_csv(args.file) # Filter columns as needed if args.col: df = df[[args.col]] # Output statistical information print(df.head(args.limit).to_string()) print("n--- Statistical Summary ---") print(df.describe()) if __name__ =="__
← Skills Skill CreatorFastapi Blog Deploy β†’