| name | halcon-developer |
| description | The ultimate expert guidance for HALCON application development using HDevelop, procedures, and standard operators. Covers XML script standards, bilingual documentation, unit testing, and headless execution. |
Ultimate HALCON Developer Skill
This skill provides comprehensive technical guidance for developing HALCON applications, procedures, and automated test suites. It focuses on the high-level logic, operator orchestration, and production-grade verification within the HALCON environment.
When to use this skill
- Use this when writing, debugging, or optimizing HDevelop scripts (
.hdev) and procedures (.hdvp).
- Use this to design automated unit tests for HALCON operators or complex vision logic.
- Use this to ensure all HALCON code follows MVTec's professional standards for structure and documentation.
- Use this to find verified implementation patterns in HALCON examples and solution guides.
How to use it
1. Unified Search & Knowledge Retrieval
Always use the search_halcon_knowledge tool with domain="halcon_development" to leverage the indexed documentation and examples.
Multi-Version Troubleshooting:
- Active Version Priority: By default, search results prioritize the currently active HALCON version in your environment.
- Explicit Version Queries: When troubleshooting issues that occur in specific versions (e.g., a script works in 24.11 but fails in 23.05), use the
halcon_version parameter to compare documentation, signatures, or examples across versions.
- Cross-Version Comparison: If an operator or procedure behavior changes, query both versions explicitly to identify deprecated parameters or changed return types.
Optimal Workflow:
- Signature Verification: Search
category="operator" to get official parameters and return values.
- Implementation Discovery: Search
source_type="example" and language="hdev" to see operators in real-world scripts.
- Modularization: Search
category="procedure" to find reusable .hdvp modules.
- Version Analysis: Use
halcon_version="X.Y" to pinpoint when a feature was introduced or modified.
2. Script & Procedure Standards
HDevelop Script (.hdev)
- Format: All
.hdev files must be valid XML.
- Header: Ensure the
<hdevelop> and <procedure name="main"> tags are correctly structured.
- Documentation: Every script must have a
<docu> block for the main procedure.
HALCON Procedure (.hdvp)
- Bilingual Mandate: Every procedure MUST be documented in both English (en_US) and German (de_DE).
- Mandatory XML Tags:
<abstract>: Detailed description of functionality.
<short>: Concise one-sentence summary.
<parameters>: Detailed description for every parameter, including semantic type.
- Naming: Use descriptive
snake_case.
3. Automated Unit Testing (hrun compatible)
All critical logic requires a unit test.
- Test-First: Create the
.hdev test script before implementation.
- Synthetic Data: Use
gen_image_const, gen_region_runs, or gen_contour_polygon_xld. Avoid external file dependencies.
- Headless Compliance:
- NEVER use
stop() or interactive operators (e.g., dev_open_dialog).
- Use
open_window(..., 'buffer', ...) for background rendering.
- Use
try/catch to report errors gracefully to stdout.
- Portability: Use relative paths or environment variables (
$HALCONROOT). NEVER use absolute paths.
4. German Localization
- Special Characters: ALWAYS use ä, ö, ü, ß. NEVER use
ae, oe, etc. in documentation text.
MCP Tool Interface
search_halcon_knowledge
domain: "halcon_development".
category: "operator", "procedure", or "example".
language: "hdev", "hdvp", or "html".
fast_search: Set to true for exact name searches or simple keyword lookups to skip the reranker and get results faster.
Conventions
- Naming: Use
snake_case for variables and procedure names.
- Error Handling: Use
dev_error_handling and structured try/catch.