init-deps-install
Skill63 starsChanged 9 months agoMITView on GitHub
Automatically triggered when Tapestry is first launched on a new environment or lacks dependencies. Intelligently detects environment and installs Tapestry dependencies with user confirmation.
- Installs packages
In this repository8 other files it gives its agents.
- displaySkill
- exportSkill
- feedSkill
- ingestSkill
- tapestrySkill
- subscriptionsSkill
- synthesisSkill
- visual-cardSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 15 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
After creating a new project that requires dependencies
- Very specific: line 29
If not, copies from tapestry.config.example.json
- Distinctive: line 70
When this skill is invoked:
- Distinctive: line 72
Check and setup configuration: if needed
- Distinctive: line 81
Before installing dependencies, check if this is the first run:
- Very specific: line 93
Check if tapestry.config.json exists
- Very specific: line 94
If not, copy from tapestry.config.example.json
- Very specific: line 96
Update paths.project_root in the config
- Distinctive: line 99
If invoked with an argument, use that path as project root
- Very specific: line 102
Update the paths.project_root field in tapestry.config.json
- Distinctive: line 116
After successful setup and installation, create a marker file:
- Distinctive: line 126
Run the environment detection script:
- Distinctive: line 143
Read and parse dependency files in order of preference:
- Distinctive: line 155
Create a structured plan with:
- Very specific: line 191
Use AskUserQuestion to present the plan:
- Distinctive: line 217
If user selects "Custom selection", present a second multi-select question with individual components.
- Distinctive: line 246
All required packages are importable
- Distinctive: line 256
Issue: No package manager detected
- Distinctive: line 270
Never install without confirmation: Always present the plan first
- Distinctive: line 271
Respect user environment: Don't modify system Python without explicit permission
- Distinctive: line 272
Handle failures gracefully: If one package fails, continue with others and report at the end
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
📦 Tapestry Init Deps Install
Automatic Dependency Installation with Environment Detection
This skill is automatically triggered when Tapestry is first launched on a new environment or when dependencies are missing. It detects the user's Python environment (venv, conda, system Python, etc.) and provides a comprehensive installation plan for all project dependencies, including both Python packages and system-level tools.
When This Skill is Triggered
This skill is automatically invoked when:
- Tapestry is first launched on a new environment (one-time auto-trigger)
- Required dependencies are missing or cannot be imported
- The user explicitly asks to "install dependencies" or "set up the project"
- After creating a new project that requires dependencies
Important: The automatic trigger only occurs the first time Tapestry runs in a new environment. After successful initialization, the skill will not auto-trigger on subsequent runs to avoid wasting tokens. Manual invocation is always available if needed.
How This Skill Works
- Configuration Setup: Checks for user configuration and creates it if missing:
- Detects if
tapestry.config.jsonexists - If not, copies from
tapestry.config.example.json - Determines the real project root path
- Updates
paths.project_rootin the config with the actual path
- Detects if
- Environment Detection: Analyzes the current environment to determine:
- Python version and location
- Virtual environment status (venv, virtualenv, conda)
- Package manager availability (pip, conda, poetry, uv)
- Existing installed packages
- Dependency Analysis: Scans for dependency files:
pyproject.toml(preferred)requirements.txtsetup.pyenvironment.yml(conda)
- Plan Generation: Creates a comprehensive installation plan including:
- Configuration file setup (if needed)
- Python package installation commands
- System-level dependencies (e.g.,
playwright install chromium) - Optional dependencies and recommendations
- Environment-specific considerations
- User Confirmation: Presents the plan and asks for approval before executing
- Installation: Executes the approved plan and reports results
Usage
This skill is automatically triggered when dependencies are missing. It can also be manually invoked:
# Manually trigger from the project root
/init-deps-install
# Or specify a project path
/init-deps-install /path/to/projectImplementation
When this skill is invoked:
- Check and setup configuration if needed
- Detect the environment by running the detection script
- Analyze dependencies from project files
- Generate an installation plan with clear steps
- Present the plan to the user with AskUserQuestion
- Execute approved steps and report results
Step 0: Configuration Setup
Before installing dependencies, check if this is the first run:
# Check if already initialized
python init-deps-install/_scripts/check_initialized.py
# Exit code 0 = already initialized, 1 = needs initialization
# If not initialized, setup configuration
python init-deps-install/_scripts/setup_config.py [project-root]The setup script will:
- Check if
tapestry.config.jsonexists - If not, copy from
tapestry.config.example.json - Determine the project root path (argument or CWD)
- Update
paths.project_rootin the config
Project Root Detection:
- If invoked with an argument, use that path as project root
- Otherwise, use the current working directory
- Convert to absolute path
- Update the
paths.project_rootfield intapestry.config.json
Example Output:
{
"config_existed": false,
"config_path": "/path/to/skills/tapestry/config/tapestry.config.json",
"project_root": "/home/user/my-tapestry-project",
"created": true,
"updated": true
}Initialization Marker: After successful setup and installation, create a marker file:
# Create .tapestry_initialized marker
python init-deps-install/_scripts/mark_initialized.pyThis marker file indicates that Tapestry has been successfully initialized and prevents the skill from auto-triggering on future runs, saving tokens.
Step 1: Environment Detection
Run the environment detection script:
python init-deps-install/_scripts/detect_env.pyThis outputs JSON with:
python_version: Python version stringpython_path: Path to Python executableenv_type: "venv", "conda", "system", or "unknown"env_name: Name of the environment (if applicable)env_path: Path to the environment (if applicable)package_manager: "pip", "conda", "poetry", "uv", or "pip" (default)installed_packages: List of currently installed packages
Step 2: Dependency Analysis
Read and parse dependency files in order of preference:
pyproject.toml- Parse[project.dependencies]and[project.optional-dependencies]requirements.txt- Parse line by linesetup.py- Look forinstall_requires
Identify:
- Core dependencies (required)
- Optional dependencies (browser support, dev tools, etc.)
- Post-install commands (e.g.,
playwright install chromium)
Step 3: Generate Installation Plan
Create a structured plan with:
Environment Summary:
- Current Python version and path
- Environment type and name
- Package manager to use
Installation Steps:
- Core dependencies installation command
- Optional dependencies (with recommendations)
- Post-install commands (system-level tools)
- Verification steps
Example Plan:
Configuration:
✓ Created tapestry.config.json from example
✓ Set project_root to: /home/user/my-project
Environment: Python 3.11.5 in conda environment 'myenv'
Package Manager: conda (with pip fallback)
Installation Steps:
1. Install core dependencies:
conda install httpx pydantic selectolax readability-lxml chardet
2. Install browser support (recommended for JavaScript-heavy sites):
pip install playwright>=1.40.0
playwright install chromium
3. [Optional] Install development tools:
pip install pytest pytest-asyncio pytest-cov black ruff mypyStep 4: User Confirmation
Use AskUserQuestion to present the plan:
{
"questions": [{
"question": "I've detected your environment and prepared an installation plan. Would you like to proceed?",
"header": "Install",
"multiSelect": false,
"options": [
{
"label": "Install all (recommended)",
"description": "Install core dependencies, browser support, and post-install tools"
},
{
"label": "Core only",
"description": "Install only required dependencies, skip optional packages"
},
{
"label": "Custom selection",
"description": "Let me choose which components to install"
}
]
}]
}If user selects "Custom selection", present a second multi-select question with individual components.
Step 5: Execute Installation
Based on user selection, execute the appropriate commands:
# Example for pip in venv
pip install -e . # If pyproject.toml exists
# OR
pip install -r requirements.txt
# Post-install commands
playwright install chromiumMonitor output and report:
- ✅ Successfully installed packages
- ⚠️ Warnings or issues
- ❌ Failed installations with error messages
Step 6: Verification
After installation, verify:
python init-deps-install/_scripts/verify_install.pyThis checks:
- All required packages are importable
- Versions meet requirements
- System tools are available (e.g., chromium for playwright)
Report verification results to the user.
Error Handling
Common issues and solutions:
Issue: No package manager detected Solution: Recommend installing pip or conda
Issue: Permission denied
Solution: Suggest using virtual environment or --user flag
Issue: Conflicting dependencies Solution: Show conflict details and suggest resolution strategies
Issue: Network errors Solution: Suggest checking internet connection or using mirrors
Important Notes
- Never install without confirmation: Always present the plan first
- Respect user environment: Don't modify system Python without explicit permission
- Handle failures gracefully: If one package fails, continue with others and report at the end
- Provide context: Explain why certain dependencies are needed
- Support multiple package managers: Detect and use the appropriate tool for the environment
Directory Structure
skills/tapestry/init-deps-install/
├── SKILL.md # This file
├── README.md # Developer documentation
├── _scripts/
│ ├── check_initialized.py # Check if Tapestry is initialized
│ ├── setup_config.py # Configuration setup from example
│ ├── mark_initialized.py # Create initialization marker
│ ├── detect_env.py # Environment detection
│ ├── parse_deps.py # Dependency parsing utilities
│ ├── verify_install.py # Post-install verification
│ └── install_deps.py # Installation orchestrator
└── _specs/
└── env_detection.md # Environment detection specificationExample Workflows
Workflow 1: Fresh Project Setup
User: "Set up this project"
Actions:
1. Check for tapestry.config.json, create from example if missing
2. Detect project root and update config
3. Detect environment (conda with Python 3.11)
4. Find pyproject.toml with dependencies
5. Generate plan:
- Configuration setup
- pip install -e .
- playwright install chromium
6. Ask user for confirmation
7. Execute approved steps
8. Verify installation
9. Create .tapestry_initialized marker
10. Report: "✅ Installed 8 packages successfully. Project ready!"Workflow 2: Missing Dependencies
User: "Install the missing dependencies"
Actions:
1. Detect environment (venv with Python 3.10)
2. Compare installed vs required packages
3. Generate plan for missing packages only
4. Ask user for confirmation
5. Execute: pip install <missing-packages>
6. Verify installation
7. Report: "✅ Installed 3 missing packages"Workflow 3: System Python (Risky)
User: "Install dependencies"
Actions:
1. Detect environment (system Python, no venv)
2. Generate plan with WARNING
3. Ask user: "⚠️ You're using system Python. Recommend creating a virtual environment first. Proceed anyway?"
4. If user confirms, install with --user flag
5. Report results with reminder to use venvKey Principle: Be transparent about what will be installed and why. Never surprise the user with unexpected system modifications.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

