Install
$ agentstack add skill-dungnotnull-craft-village-heritage-tourism-agent-skill-config ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
SKILL Registry — craft-village-heritage-tourism
Overview
The SKILL Registry is the central system for managing, resolving, and executing all skills in the craft-village-heritage-tourism project — a Claude Code harness for the Craft-Village Heritage Tourism & Living Culture domain. This document describes how skills are registered, how they are resolved during execution, their input/output JSON schemas, and how they are validated.
The registry sits on top of four reusable subsystems in config/:
- Configuration (
config/__init__.py) — type-safeSystemConfig, feature flags, env overrides. - Hooks (
config/hooks.py) —HookRegistryemitting named lifecycle events. - Logging (
config/logging.py) — structuredStructuredLoggerwith performance tracking. - Tools (
config/tools.py) —ToolRegistrywith schema-validated execution handlers.
Skill Architecture
Hierarchical Structure with Chain-of-Thought Router
craft-village-heritage-tourism (Main Skill / Orchestrator)
├── Pre-Flight Router (language + intent detection)
├── Sub-skills (sequential pipeline with router dispatch)
│ ├── sub-gather-requirements (Step 1 — intake)
│ ├── sub-evidence-collector (Step 2 — real-time + authoritative data)
│ ├── sub-core-analysis (Step 3 — experience/IP/capacity planning)
│ ├── sub-knowledge-updater (Step 4 — academic grounding)
│ └── sub-advisor (Step 5 — risk-disclosed synthesis)
├── Tools (dynamic invocation via ToolRegistry)
│ ├── web_search
│ ├── knowledge_query
│ ├── carrying_capacity
│ ├── community_benefit
│ └── experience_design
└── Quality Gates (enforcement)
├── Universal Gates (U1-U6)
└── Domain Gates (G1-G4)
The orchestrator is not a rigid pipeline: the main harness acts as a chain-of-thought router. Each step output is inspected; if a quality gate fails the router re-dispatches the responsible sub-skill (max 2 retries) before escalating to a degradation level. This combines the predictability of a fixed bookend flow (requirements → evidence → core → knowledge → synthesis → quality gate) with the adaptability of a router that can re-enter earlier stages to repair evidence gaps.
Skill Resolution Process
- Discovery — Skills are discovered from the
skills/directory. - Registration — Each skill YAML frontmatter is parsed and registered.
- Validation — Skill schemas are validated against the contract (name, description, required sections).
- Execution — Skills are executed in order, emitting
SUBSKILL_BEFORE_INVOKE/SUBSKILL_AFTER_INVOKEhooks.
Skill Registration
Frontmatter Schema
Every skill MUST include YAML frontmatter:
---
name: skill-name # Unique identifier (kebab-case)
description: one-line summary # When to trigger, what it does
---
Registration Process
- Scan
skills/directory for*.mdfiles. - Parse YAML frontmatter from each file.
- Validate required fields (
name,description). - Extract skill metadata (sections, tools, gates, language support).
- Register in the skill registry with metadata.
Skill Metadata Extraction
From each skill file, the system extracts:
- Sections — Role & Persona, Workflow, Tools, Output Format, Quality Gates.
- Tool Dependencies — tools the skill requires.
- Gate Dependencies — quality gates the skill participates in.
- Language Support — whether the skill supports multiple languages.
- Sub-skills — for
main.md, the list of sub-skills it orchestrates.
Skill Execution Model
Main Harness Execution
USER INPUT → Pre-Flight (language + intent detection) → Step 1 → Step 2 → Step 3 → Step 4 → Step 5 → Quality Gates → OUTPUT
Sub-Skill Execution
- Invoke —
Skill("sub-skill-name")called. - Pre-hook —
SUBSKILL_BEFORE_INVOKEemitted (router logs dispatch). - Execute — sub-skill runs with its context.
- Post-hook —
SUBSKILL_AFTER_INVOKEemitted. - Validate — quality gates checked; on failure the router re-dispatches.
- Continue — next sub-skill or error handling.
Error Handling
If a sub-skill fails:
- Hook —
SUBSKILL_ON_FAILUREemitted (audit trail records it). - Retry — up to 3 attempts with exponential backoff.
- Fallback — graceful degradation to a lower quality level.
- Recovery — continue with the next sub-skill if non-critical.
- Failure — if critical, halt and emit
SKILL_ON_ERROR.
Input/Output Schemas
Generic Skill Input
interface SkillInput {
skill_name: string;
parameters: Record;
context: {
execution_id: string;
language: string; // "en" | "vi"
degradation_level: number; // 0-4
metadata: Record;
};
}
Generic Skill Output
interface SkillOutput {
success: boolean;
skill_name: string;
result: {
data: any;
metadata: Record;
};
gates_passed: string[];
gates_failed: string[];
execution_time_ms: number;
timestamp: string; // ISO 8601
}
Skill-Specific Schemas
sub-gather-requirements
Input:
{
raw_message: string;
provided_materials: any[];
}
Output:
{
object: string; // e.g. "Bat Trang ceramics village tourism plan"
scope: string;
timeframe: string;
available_inputs: any[];
target_audience: string;
language: string; // "en" | "vi"
analysis_type: string; // default "combined"
}
sub-evidence-collector
Input:
{ requirements: object; } // from sub-gather-requirements
Output:
{
current_data: any[];
authoritative_docs: any[];
recent_news: any[];
reference_benchmarks: any[];
sources: Array;
}
sub-core-analysis
Input:
{
village: string;
craft: string;
capacity: object; // carrying-capacity inputs
community: object; // community-benefit inputs
language: string;
}
Output:
{
village_profile: object;
authentic_experiences: object; // from experience_design tool
interpretation_storytelling: string[];
community_benefit_ip: object; // from community_benefit tool
carrying_capacity: object; // from carrying_capacity tool
sustainability_marketing: object;
scenarios: {best: object, base: object, worst: object};
}
sub-knowledge-updater
Input:
{ keywords: string[]; max_results?: number; }
Output:
{
citations: Array;
gaps: string[];
coverage_rating: string; // "Strong" | "Moderate" | "Weak"
}
sub-advisor
Input:
{
core_analysis: object;
evidence_bundle: object;
knowledge_evidence: object;
}
Output:
{
conclusion: string; // "Sustainable Plan" | "Conditional (capacity)" | "Over-Commercialization Risk" | "Inconclusive"
scenarios: {best: object, base: object, worst: object};
key_risks: Array;
evidence_chain: Array;
remediation: string[];
disclosure: string;
}
Quality Gate Validation
Gate Enforcement
- Pre-hook —
GATE_BEFORE_CHECKemitted. - Check — gate condition evaluated.
- Decision — pass or fail.
- Auto-fix — if enabled and failed, attempt auto-fix.
- Retry — re-check after auto-fix (max 2 retries).
- Post-hook —
GATE_AFTER_CHECKemitted. - Failure —
GATE_ON_FAILUREemitted; limitation notice added.
Universal Gates (U1-U6)
| Gate | Condition | Auto-Fix | |------|-----------|----------| | U1 | ≥3 sources cited, ≥1 academic/authoritative | Fetch from knowledge base | | U2 | Disclosure before recommendation | Prepend disclosure | | U3 | Evidence hierarchy per source | Annotate tiers | | U4 | Language matches user preference | Translate output | | U5 | Output uses template | Reformat | | U6 | Every claim traceable | Flag unsupported |
Domain Gates (G1-G4)
| Gate | Condition | Auto-Fix | |------|-----------|----------| | G1 | Authentic experiences designed | Invoke experience_design tool | | G2 | Community benefit & artisan IP | Invoke community_benefit tool | | G3 | Carrying capacity & infrastructure | Invoke carrying_capacity tool | | G4 | Sustainability & marketing | Add sustainability/marketing block |
Tool Integration
Tool Invocation
from config.tools import register_builtin_tools, get_tool_registry
register_builtin_tools()
registry = get_tool_registry()
result = registry.execute(
"carrying_capacity",
usable_area_m2=2000,
ecological_weight=0.6,
)
if result.success:
report = result.data
else:
error = result.error
Available Tools
See config/tools.py for complete definitions:
| Tool | Category | Purpose | |------|----------|---------| | websearch | datafetch | Search web for current craft-village / ICH / artisan evidence | | knowledgequery | knowledgequery | In-process search over SECOND-KNOWLEDGE-BRAIN.md | | carryingcapacity | analysis | Physical/Real/Ecological carrying-capacity model | | communitybenefit | analysis | Community benefit & artisan IP scoring (0-10) | | experience_design | analysis | Authentic experience module plan + interpretation hooks |
Configuration Integration
from config import get_config, FeatureFlag
config = get_config()
model = config.llm.model_name
budget = config.available_context_budget()
if config.is_feature_enabled(FeatureFlag.ENABLE_CARRYING_CAPACITY_MODEL):
pass # use carrying_capacity tool
Feature Flags
| Flag | Effect | |------|--------| | ENABLEWEBSEARCH | Allow live web search | | ENABLESEMANTICSCHOLAR | Allow Semantic Scholar crawl | | ENABLEARXIVCRAWL | Allow ArXiv crawl | | ENABLERSSFEEDS | Allow RSS ingestion | | ENABLEAUTOUPDATE | Allow scheduled knowledge updates | | ENABLEGRACEFULDEGRADATION | Allow degradation fallbacks | | ENABLESTRICTMODE | Fail-fast on any gate failure | | ENABLECOMMUNITYBENEFITCHECK | Enforce G2 via community_benefit tool | | ENABLECARRYINGCAPACITYMODEL | Enforce G3 via carrying_capacity tool |
Performance Monitoring
from config.logging import get_logger
logger = get_logger("skill_execution")
with logger.performance_tracking("sub-core-analysis"):
result = execute_skill("sub-core-analysis", **params)
Statistics:
from config.tools import get_tool_registry
stats = get_tool_registry().get_stats("carrying_capacity")
print(stats["execution_count"], stats["avg_execution_time_ms"])
Context-Window Management
The harness bounds token consumption by:
- Reserving
reserved_output_tokens(default 4096) from the model context window. - Sizing evidence/knowledge payloads against
available_context_budget(). - Streaming sub-skill outputs as compact structured envelopes (see schemas) instead of full prose until the final synthesis step.
- Capping knowledge citations at 3-5 entries and news items at 2-3 per run.
Extension Points
Adding a New Skill
- Create
skills/new-skill.mdwith proper frontmatter. - Implement required sections (Role, Workflow, Tools, Output, Gates).
- Add input/output schemas to this document.
- Register in
main.mdif it is a sub-skill. - Add a test scenario to
tests/test-scenarios.md.
Adding a New Tool
- Define the
ToolSchemainconfig/tools.py. - Implement a
ToolHandlersubclass with a realexecute(). - Register it in
register_builtin_tools(). - Document input/output in this
SKILL.md. - Add usage examples.
Adding a New Hook
- Add the event to
HookEventinconfig/hooks.py. - Register a handler at the appropriate lifecycle point.
- Document the hook purpose and context.
- Add test coverage for the hook behavior.
Validation
Skill Validation
- Frontmatter — must include
nameanddescription. - Sections — must include required sections.
- Schema — input/output must match defined schemas.
- Gates — must specify quality gates.
- Tools — must specify required tools.
Configuration Validation
from config import get_config, validate_config
errors = validate_config(get_config())
if errors:
for e in errors:
print("Validation error: " + e)
References
- Main Skill —
skills/main.md - Sub-Skills —
skills/sub-*.md - Tool Definitions —
config/tools.py - Hook System —
config/hooks.py - Logging —
config/logging.py - Configuration —
config/__init__.py - JSON Schemas —
assets/schemas.json - Domain Methods —
references/domain-methods.md - Prompt Templates —
references/prompt-templates.md
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: dungnotnull
- Source: dungnotnull/craft-village-heritage-tourism-agent-skill
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.