acc-troubleshooting-template
npx skills add https://github.com/dykyi-roman/awesome-claude-code --skill acc-troubleshooting-template
Agent 安装分布
Skill 文档
Troubleshooting Template Generator
Generate helpful troubleshooting guides and FAQ documentation.
Document Structure
# Troubleshooting
## Quick Fixes
{common issues with quick solutions}
## Installation Issues
{installation problems}
## Configuration Issues
{config problems}
## Runtime Errors
{errors during execution}
## FAQ
{frequently asked questions}
## Getting Help
{how to report issues}
Section Templates
Quick Fixes Section
## Quick Fixes
### Reset to Known Good State
```bash
# Clear cache
rm -rf var/cache/*
# Reinstall dependencies
rm -rf vendor/ composer.lock
composer install
# Verify installation
php vendor/bin/package verify
Check Common Issues
| Symptom | Quick Fix |
|---|---|
| “Class not found” | Run composer dump-autoload |
| Permission denied | Run chmod -R 755 var/ |
| Config not loading | Check .env file exists |
| Connection refused | Verify service is running |
### Installation Issues Section
```markdown
## Installation Issues
### Composer Install Fails
**Symptom:**
Your requirements could not be resolved to an installable set of packages.
**Solutions:**
1. **Update Composer:**
```bash
composer self-update
-
Clear Composer cache:
composer clear-cache -
Check PHP version:
php -v # Must be 8.5 or higher -
Check required extensions:
php -m | grep -E "json|pdo|mbstring"
Extension Not Found
Symptom:
PHP Fatal error: Uncaught Error: Call to undefined function json_encode()
Solution:
Install missing PHP extension:
# Ubuntu/Debian
sudo apt-get install php8.5-json
# macOS with Homebrew
brew install php@8.5
# Verify
php -m | grep json
### Configuration Issues Section
```markdown
## Configuration Issues
### Environment Variables Not Loading
**Symptom:**
API key not configured
**Checklist:**
1. **Verify `.env` file exists:**
```bash
ls -la .env
-
Check variable is set:
grep "PACKAGE_API_KEY" .env -
Verify no syntax errors:
# Values with spaces need quotes PACKAGE_NAME="My App Name" # â Correct PACKAGE_NAME=My App Name # â Wrong -
Clear config cache:
php artisan config:clear # Laravel rm var/cache/config.php # Other frameworks
Invalid Configuration Value
Symptom:
Configuration error: 'timeout' must be a positive integer
Solution:
Check config/package.php:
// â Wrong
'timeout' => '30', // String instead of int
// â
Correct
'timeout' => 30, // Integer
### Runtime Errors Section
```markdown
## Runtime Errors
### Connection Timeout
**Symptom:**
Error: Connection timed out after 30 seconds
**Possible Causes:**
1. **Network issues** â Check connectivity
2. **Firewall blocking** â Check outbound rules
3. **Service down** â Check status page
4. **Timeout too short** â Increase timeout
**Solutions:**
```php
// Increase timeout
$client = new Client([
'timeout' => 60, // 60 seconds
]);
# Test connectivity
curl -v https://api.example.com/health
Rate Limit Exceeded
Symptom:
{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests"
}
}
Solutions:
-
Implement backoff:
$client = new Client([ 'retry' => [ 'max_attempts' => 3, 'delay' => 1000, // ms ], ]); -
Cache responses:
$cache = new RedisCache(); $client = new Client(['cache' => $cache]); -
Upgrade plan for higher limits
Memory Limit Exceeded
Symptom:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
Solutions:
-
Process in batches:
foreach ($client->paginate(100) as $batch) { process($batch); } -
Increase memory limit:
ini_set('memory_limit', '256M'); -
Use generators:
foreach ($client->stream() as $item) { yield process($item); }
### FAQ Section
```markdown
## FAQ
### General
<details>
<summary><strong>Q: What PHP version is required?</strong></summary>
PHP 8.5 or higher is required. Check your version:
```bash
php -v
Yes, the library is used in production by many projects. We follow semantic versioning and maintain backward compatibility within major versions.
Configuration
Use environment-specific .env files:
.env # Base configuration
.env.local # Local overrides (not committed)
.env.test # Test environment
.env.prod # Production environment
Yes, you can pass configuration directly:
$client = new Client([
'api_key' => getenv('MY_API_KEY'),
]);
Performance
- Enable caching â Reduces API calls
- Use connection pooling â Reuse connections
- Batch requests â Reduce round trips
- Use async â Parallel processing
$client = new Client([
'cache' => new RedisCache(),
'pool_size' => 10,
]);
Getting Help Section
## Getting Help
### Before Asking for Help
1. **Search existing issues:** [GitHub Issues](https://github.com/vendor/package/issues)
2. **Check documentation:** [Docs](https://docs.example.com)
3. **Review changelog:** [CHANGELOG.md](CHANGELOG.md)
### Collect Debug Information
Run this command and include output in your issue:
```bash
php -v
composer show vendor/package
php -m | grep -E "json|pdo|curl"
Report a Bug
Create an issue with:
- Description â What happened?
- Expected â What should have happened?
- Steps to reproduce â How can we reproduce it?
- Environment â PHP version, OS, package version
- Error message â Full stack trace
Ask a Question
- ð¬ GitHub Discussions
- ð Stack Overflow
## Complete Example
```markdown
# Troubleshooting
## Quick Fixes
| Problem | Solution |
|---------|----------|
| Class not found | `composer dump-autoload` |
| Permission denied | `chmod -R 755 var/` |
| Config missing | Check `.env` exists |
## Common Errors
### "Invalid API Key"
**Symptom:**
Error: Invalid API key provided
**Solutions:**
1. Verify key in `.env`:
```bash
grep "API_KEY" .env
-
Check for extra whitespace:
API_KEY=abc123 # â No quotes needed API_KEY= abc123 # â Extra space -
Regenerate key at dashboard
FAQ
Free tier allows 100 requests/hour. Upgrade for more.
Get Help
- ð Documentation
- ð Report Bug
- ð¬ Ask Question
## Generation Instructions
When generating troubleshooting docs:
1. **Start with symptoms** â What user sees
2. **Explain causes** â Why it happens
3. **Provide solutions** â Step-by-step fixes
4. **Include verification** â How to confirm fix
5. **Use collapsible FAQ** â Reduce scrolling
6. **Link to help** â Where to get more support