# Smart City Ewaste Recycling

> E-Waste Management & Recycling Advisor for Smart Cities — Comprehensive Urban E-Waste Management & Circular Electronics analysis harness with real-time data aggregation, academic research integration, and risk-disclosed recommendations. Use this skill whenever the user asks about e-waste management, urban recycling, electronic waste collection, circular economy for electronics, smart city waste s…

- **Type:** Skill
- **Install:** `agentstack add skill-dungnotnull-smart-city-ewaste-recycling-agent-skill-smart-city-ewaste-recycling-agent-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dungnotnull](https://agentstack.voostack.com/s/dungnotnull)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dungnotnull](https://github.com/dungnotnull)
- **Source:** https://github.com/dungnotnull/smart-city-ewaste-recycling-agent-skill

## Install

```sh
agentstack add skill-dungnotnull-smart-city-ewaste-recycling-agent-skill-smart-city-ewaste-recycling-agent-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# SKILL.md — Smart City E-Waste Recycling Skill Registry

## Overview

This document provides the complete skill registry for the `smart-city-ewaste-recycling` harness, including registration protocols, resolution mechanisms, execution flows, validation schemas, and input/output specifications.

## Skill Registration

### Registration Protocol

The skill registers itself through the following mechanisms:

1. **Primary Registration**: `SKILL.md` (this file) - serves as the canonical registry
2. **Frontmatter Registry**: YAML block at top of `skills/main.md`
3. **Manifest Entry**: Library-level progression tracking in `D:\972026\progression.json`
4. **Hook Integration**: Event-driven hooks in `/hooks` directory

### Registration Metadata

```yaml
skill_identifier: smart-city-ewaste-recycling
version: 2.0.0
last_updated: 2026-07-27
status: production-ready
phase: Phase 5 (Integration & Polish)
library_standard: 1.0
base_directory: D:\972026\242-smart-city-ewaste-recycling
```

## Skill Resolution

### Resolution Mechanism

When a user invokes `/smart-city-ewaste-recycling` or provides relevant input, the skill resolves through:

1. **Trigger Detection**: Description matching in `SKILL.md` frontmatter
2. **Context Loading**: Multi-level progressive disclosure system
3. **Sub-Skill Resolution**: Recursive resolution of dependent sub-skills
4. **Resource Binding**: Dynamic binding of bundled resources

### Resolution Priority

```
1. User explicit invocation (/smart-city-ewaste-recycling)
2. Semantic trigger detection (description matching)
3. Domain keyword detection (e-waste, urban recycling, WEEE, etc.)
4. Context inference (smart city, circular economy, electronics sustainability)
```

### Context Loading Levels

**Level 1 - Metadata (~100 words)**
- Skill name, description, version
- Always loaded in Claude context

**Level 2 - SKILL.md Body ( B[Pre-Flight: Language Detection]
    B --> C[Step 1: sub-gather-requirements]
    C --> D{Gate G0: Object Confirmed?}
    D -->|No| C
    D -->|Yes| E[Step 2: sub-evidence-collector]
    E --> F{Gate G1: Data Retrieved?}
    F -->|No (2x)| G[Degradation Level 1]
    F -->|Yes| H[Step 3: sub-core-analysis]
    H --> I{Gate G2: Analysis Complete?}
    I -->|No (2x)| J[Degradation Level 2]
    I -->|Yes| K[Step 4: sub-knowledge-updater]
    K --> L{Gate G3: Evidence Found?}
    L -->|No (2x)| M[Degradation Level 3]
    L -->|Yes| N[Step 5: sub-advisor]
    N --> O{Gate G4: Conclusion Valid?}
    O -->|No (2x)| P[Degradation Level 4]
    O -->|Yes| Q[Quality Gate Review]
    Q --> R{All Gates Pass?}
    R -->|Yes| S[Deliver Output]
    R -->|No| T[Auto-Fix Loop]
    T --> Q
```

### Sub-Skill Execution Matrix

| Sub-Skill | Tool Access | Output Format | Retry Logic |
|-----------|-------------|----------------|-------------|
| sub-gather-requirements | Conversation | Structured requirements | Re-prompt user |
| sub-evidence-collector | WebSearch, WebFetch, Read | Evidence bundle | Fallback to KB |
| sub-core-analysis | Read, WebFetch, Reasoning | Scorecard/analysis | Fallback to frameworks |
| sub-knowledge-updater | Read, WebSearch | Citations + tier labels | Flag gaps |
| sub-advisor | Skill, Reasoning | Conclusion + disclosure | Force to template |

## Skill Validation

### Validation Schemas

**Input Validation:**

```json
{
  "user_query": {
    "type": "string",
    "min_length": 10,
    "required": true,
    "validation": "non_empty_meaningful_content"
  },
  "language": {
    "type": "string",
    "enum": ["en", "vi", "other"],
    "default": "en"
  }
}
```

**Output Validation:**

```json
{
  "report_structure": {
    "required_sections": [
      "Executive Summary",
      "Inputs & Scope",
      "Evidence Collected",
      "Analysis / Scorecard",
      "Control / Action Plan",
      "Academic Evidence",
      "Verdict / Conclusion",
      "Key Risks",
      "Evidence Chain",
      "Recommended Actions",
      "Disclosure / Limitations"
    ],
    "validation": "all_sections_present_and_populated"
  },
  "quality_gates": {
    "universal_gates": ["U1", "U2", "U3", "U4", "U5", "U6"],
    "domain_gates": ["G1", "G2", "G3", "G4"],
    "pass_criteria": "all_gates_must_pass"
  }
}
```

### Quality Gate Enforcement

```python
# Gate validation schema
gates = {
    "U1": {"check": "source_count >= 3", "academic": ">= 1", "fix": "append_missing"},
    "U2": {"check": "disclosure_position", "before": "recommendation", "fix": "prepend_disclosure"},
    "U3": {"check": "tier_labels_present", "tiers": [1,2,3,4], "fix": "annotate_tiers"},
    "U4": {"check": "language_match", "fix": "translate_output"},
    "U5": {"check": "template_compliance", "fix": "reformat_to_template"},
    "U6": {"check": "claim_traceability", "fix": "flag_unsupported"},
    
    "G1": {"check": "flows_mapped", "fix": "map_e_waste_flows"},
    "G2": {"check": "collection_recycling_specified", "fix": "specify_collection_recycling"},
    "G3": {"check": "hazards_mitigated", "fix": "mitigate_hazards"},
    "G4": {"check": "policy_compliance", "fix": "ensure_compliance"}
}
```

## Sub-Skill Registry

### Sub-Skill Resolution Table

| Sub-Skill File | Name | Purpose | Dependencies | Tools Required |
|----------------|------|---------|--------------|----------------|
| `sub-gather-requirements.md` | Requirements Intake | Clarify analysis parameters | None | Conversation |
| `sub-evidence-collector.md` | Evidence Collection | Fetch authoritative data | Requirements output | WebSearch, WebFetch, Read |
| `sub-core-analysis.md` | Core Analysis | Domain-specific analysis | Evidence bundle | Read, WebFetch, Reasoning |
| `sub-knowledge-updater.md` | Knowledge Query | Surface academic evidence | Topic keywords | Read, WebSearch |
| `sub-advisor.md` | Synthesis & Recommendation | Final conclusion | All prior outputs | Skill, Reasoning |

### Sub-Skill JSON Schemas

**Requirements Output Schema:**

```json
{
  "requirements": {
    "object": "string",
    "scope": "string",
    "timeframe": "string",
    "available_inputs": ["string"],
    "target_audience": "string",
    "language": "en|vi",
    "analysis_type": "string"
  }
}
```

**Evidence Bundle Schema:**

```json
{
  "evidence_bundle": {
    "current_data": {
      "source": "string",
      "date": "ISO8601",
      "content": "object"
    },
    "authoritative_docs": [{
      "title": "string",
      "url": "string",
      "tier": 1|2|3|4,
      "key_points": ["string"]
    }],
    "recent_news": [{
      "title": "string",
      "url": "string",
      "date": "ISO8601",
      "summary": "string"
    }],
    "reference_benchmarks": {
      "metric": "value",
      "source": "string"
    }
  }
}
```

## Error Handling & Degradation

### Error Types and Recovery

| Error Type | Recovery Strategy | Degradation Level |
|------------|-------------------|-------------------|
| Network Failure | Fallback to knowledge base | Level 1-2 |
| Source Unavailable | Alternative sources + flag | Level 1 |
| Timeout | Retry with reduced scope | Level 2 |
- Parse Error | Skip problematic content | Level 2-3 |
| Language Mismatch | Auto-translate | Level 1 |
| Quality Gate Failure | Auto-fix or explicit flag | Level 3-4 |
| Sub-Skill Failure | Graceful degradation | Level 3 |
| Complete Failure | Limitation disclosure | Level 4 |

### Degradation Level Indicators

```markdown
**LIMITATION LEVEL 1:** Some real-time data unavailable; using knowledge base.
**LIMITATION LEVEL 2:** Network issues; using cached data with reduced scope.
**LIMITATION LEVEL 3:** Critical sources unavailable; analysis based on partial data.
**LIMITATION LEVEL 4:** Severe limitations; results inconclusive. Manual review required.
```

## Hooks System

### Hook Registration

Hooks are registered in `/hooks/` directory with the following naming convention:

```
hooks/
├── pre-execution/       # Before skill execution
├── post-execution/      # After skill execution
├── on-error/           # Error handling hooks
└── lifecycle/          # Lifecycle management hooks
```

### Hook Execution Order

```javascript
1. pre-execution/language-detection.md
2. pre-execution/context-validation.md
3. [Skill execution - Steps 1-6]
4. post-execution/output-validation.md
5. post-execution/quality-gate-check.md
6. lifecycle/knowledge-update.md (if triggered)
```

### Hook Schema

```yaml
hook_name: description
trigger: event_type
priority: number
condition: boolean_expression
action: function_call
output: schema_definition
```

## Performance Optimization

### Context Window Management

- **Progressive Disclosure**: Load only necessary content
- **Token Budgeting**: Allocate 2K tokens per sub-skill maximum
- **Caching Strategy**: Cache frequently accessed knowledge base sections
- **Cleanup Protocol**: Clear resolved sub-skills after execution

### Token Consumption Tracking

```python
# Token tracking schema
token_usage = {
    "metadata": "~100",
    "skill_body": "~500 lines",
    "sub_skills": {
        "sub-gather-requirements": "2K max",
        "sub-evidence-collector": "4K max",
        "sub-core-analysis": "8K max",
        "sub-knowledge-updater": "2K max",
        "sub-advisor": "4K max"
    },
    "quality_gates": "1K max",
    "total_estimated": "21K max per session"
}
```

## Integration Points

### External Tool Integration

**WebSearch:** Live domain news, reports, standards updates
**WebFetch:** Scrape authoritative sources
**Read:** Read knowledge base and reference files
**Write:** Append to knowledge base (knowledge pipeline)
**Skill:** Invoke sub-skills recursively
**Bash:** Execute knowledge pipeline (scheduled)

### Knowledge Pipeline Integration

```bash
# Weekly academic update (Mondays 8:00 AM)
0 8 * * 1 python tools/knowledge_updater.py >> logs/knowledge_update.log 2>&1

# Daily news update (Daily 7:00 AM)
0 7 * * * python tools/knowledge_updater.py --news-only >> logs/knowledge_news.log 2>&1
```

## Version History

| Version | Date | Changes |
|---------|------|---------|
| 2.0.0 | 2026-07-27 | Production-grade architecture with flexible agent system |
| 1.0.0 | 2026-07-13 | Initial production release |

## Maintenance Guidelines

### Update Protocol

1. **Schema Updates**: Update JSON schemas in this file first
2. **Sub-Skill Changes**: Update sub-skill resolution table
3. **New Hooks**: Register in hooks system section
4. **Version Bump**: Update version history and all frontmatter

### Testing Protocol

```bash
# Run full test suite
python tools/run_test_scenarios.py --all

# Test knowledge pipeline
python tools/test_knowledge_updater.py

# Validate project structure
python tools/validate_project.py
```

## Support & Debugging

### Debug Mode

```bash
# Enable debug logging
export SKILL_DEBUG=1
/smart-city-ewaste-recycling --debug [query]
```

### Common Issues

| Issue | Cause | Solution |
|-------|-------|----------|
| Skill not triggering | Description mismatch | Update SKILL.md frontmatter |
| Quality gate failures | Insufficient evidence | Run knowledge updater |
| Language detection errors | Unusual input | Manual language override |
| Sub-skill timeouts | Network issues | Check degradation levels |

---

**End of SKILL.md Registry Document**

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dungnotnull](https://github.com/dungnotnull)
- **Source:** [dungnotnull/smart-city-ewaste-recycling-agent-skill](https://github.com/dungnotnull/smart-city-ewaste-recycling-agent-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dungnotnull-smart-city-ewaste-recycling-agent-skill-smart-city-ewaste-recycling-agent-skill
- Seller: https://agentstack.voostack.com/s/dungnotnull
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
