How to integrate and use impeccable





How to integrate and use impeccable
Actually, it’s nothing special—just integrating a design tool into the HagiCode project,勉强算是个完整方案吧—including repository structure, multilingual workflows, content maintenance, and more, all gradually explored through practice.
Background
Speaking of UI/UX design quality in software development, it’s actually quite important, as it directly determines the product’s user experience and commercial success. However, in traditional development workflows, there’s always an invisible wall between designers and developers: designers create beautiful static mockups, developers strive to implement them, but there are always some discrepancies in details. This separation makes it difficult for the final product to fully match the design vision, and iteration costs rise accordingly.
When HagiCode project was working on desktop applications and Web products, it also needed professional UI/UX design support, while requiring close collaboration between design and code implementation. For this reason, we introduced the impeccable tool—a professional AI-driven front-end interface design and optimization tool. impeccable not only provides design guidance but can also directly handle code implementation, filling some of the gap between design and development.
To enable effective integration and use of impeccable in the HagiCode monorepo, we need to establish standardized integration methods, documentation processes, and maintenance specifications. This includes tool installation and configuration, skill integration, documentation site construction, and best practices for team collaboration.
About HagiCode
The solution shared in this article comes from our practical experience in the HagiCode project. HagiCode is an AI code assistant project that provides both Web and desktop versions, helping developers improve coding efficiency. During development, we needed high-quality design tools to support the product’s UI/UX construction, and impeccable was introduced into the project under this background.
Technical Architecture Analysis
impeccable’s skill-driven design
impeccable adopts a skill-driven design architecture, defining the context and behavior of different design tasks through standardized skill files. In the HagiCode project, impeccable is integrated as an npm skill package, mainly used in the following ways:
-
Skill file structure:
/home/newbe36524/.agents/skills/impeccable/SKILL.mddefines the complete skill configuration, including command sets, tool permissions, parameter hints, and license information. -
Command classification system: impeccable divides design tasks into six major categories:
- Build: Build-type commands (craft, shape, teach, document, extract)
- Evaluate: Evaluation-type commands (critique, audit)
- Refine: Optimization-type commands (polish, bolder, quieter, distill, harden, onboard)
- Enhance: Enhancement-type commands (animate, colorize, typeset, layout, delight, overdrive)
- Fix: Fix-type commands (clarify, adapt, optimize)
- Iterate: Iteration-type commands (live)
Documentation site requirements analysis
To support team use of impeccable, HagiCode established an independent documentation site impeccable-site, which needs to meet the following requirements:
- Multilingual support: Provide complete documentation in English and Chinese to meet international team needs
- Command catalog: Unified display of all commands, including categories, descriptions, and reference links
- Localized content: Maintain HagiCode-specific usage guides and best practices
- Static generation: Use Astro to build static sites for easy deployment and access
Integration challenges
The following challenges were faced during integration:
-
Source code synchronization: The upstream impeccable repository contains complete tool code and documentation, but requires selective integration of the documentation portion to avoid depending on the entire tool codebase
-
Content maintenance: Need to maintain localized content and usage guides while keeping upstream updates synchronized
-
Build process: Establish automated content synchronization, catalog generation, and site build processes
-
Multilingual workflow: Design efficient translation and localization maintenance processes
Solution Design
Repository structure design
Integrate the upstream impeccable repository through Git submodule mechanism:
[submodule "vendor/impeccable"] path = vendor/impeccable url = https://github.com/pbakaus/impeccable.gitThe advantages of this design include:
- Version control: Can precisely control upstream versions, avoiding problems caused by accidental updates
- Lightweight integration: Only fetch needed source code, avoiding introducing unnecessary dependencies
- Flexible updates: Can selectively update upstream content
Content model design
Adopt a layered content model:
- Upstream source code:
vendor/impeccable/- Provides original command definitions and reference documentation - Localized content:
src/content/commands/- Maintains Chinese and English command descriptions - Shared UI copy:
src/i18n/locales/- Manages multilingual text for the site interface - Generated catalog:
src/lib/generated/command-catalog.json- Command catalog generated at build time
Build process optimization
Design an automated build process, integrating each step through npm scripts:
{ "scripts": { "prepare": "npm run i18n:generate && npm run catalog:generate", "i18n:generate": "node scripts/generate-i18n-resources.mjs", "catalog:generate": "node scripts/build-command-catalog.mjs", "content:sync:vendor": "node scripts/sync-vendor-command-content.mjs", "validate": "npm run i18n:check && npm run catalog:check && npm run typecheck && npm run test && npm run build" }}The build process is divided into four stages:
- Preparation stage: Generate multilingual resources and command catalog
- Content synchronization: Synchronize command content from upstream to local
- Validation stage: Check content integrity and build correctness
- Build output: Generate static site files
Multilingual workflow
Establish a standardized multilingual workflow based on the hagi18n toolchain:
localesRoot: src/i18n/localesrepoRoot: .baseLocale: en-UStargetLocales: - zh-CNProvide complete maintenance scripts:
i18n:audit- Check translation completenessi18n:sync- Synchronize translation entriesi18n:prune- Clean up outdated translationsi18n:doctor- Diagnose translation issues
Practice Guide
Initial setup
First initialize the submodule and install dependencies:
# Enter monorepo root directorycd /home/newbe36524/repos/hagicode-mono
# Initialize submodulegit submodule update --init --recursive
# Enter impeccable-site directorycd repos/impeccable-site
# Install dependenciesenv -u NPM_CONFIG_PREFIX npm installThis step is the foundation of the entire integration process. If submodule initialization fails, all subsequent steps cannot proceed. HagiCode encountered this problem during the first integration and later clarified the initialization steps in the documentation.
Daily development workflow
Execute daily development commands in the repos/impeccable-site directory:
# Start development serverenv -u NPM_CONFIG_PREFIX npm run dev
# Type checkingenv -u NPM_CONFIG_PREFIX npm run typecheck
# Run testsenv -u NPM_CONFIG_PREFIX npm test
# Build siteenv -u NPM_CONFIG_PREFIX npm run build
# Complete validationenv -u NPM_CONFIG_PREFIX npm run validateThe development server runs by default at http://localhost:31266, and the port can be customized through the environment variable PORT_IMPECCABLE_SITE. HagiCode team members discovered during development that when frequently switching between different language environments, using a unified prefix command can avoid environment variable pollution issues.
Content maintenance strategy
When adding or updating command documentation, you need to create corresponding files in two language directories:
# English command documentationsrc/content/commands/en-US/polish.mdx
# Chinese command documentationsrc/content/commands/zh-CN/polish.mdxEach MDX file needs to contain frontmatter metadata:
---title: "Polish"slug: "polish"seoTitle: "Polish Command - Impeccable"seoDescription: "Final quality pass before shipping with impeccable polish command"routeSlug: "polish"highlights: - "Visual hierarchy review" - "Spacing and typography optimization" - "Accessibility validation"related: - "audit" - "critique"---Upstream content synchronization
When upstream impeccable updates, you need to synchronize the latest command content:
# Update submodulecd /home/newbe36524/repos/hagicode-mono/repos/impeccable-sitegit submodule update --remote vendor/impeccable
# Synchronize command contentenv -u NPM_CONFIG_PREFIX npm run content:sync:vendor
# Synchronize single commandenv -u NPM_CONFIG_PREFIX node scripts/sync-vendor-command-content.mjs --slug polish
# Regenerate catalogenv -u NPM_CONFIG_PREFIX npm run catalog:generateThe synchronization script reads upstream command content from vendor/impeccable/site/content/skills/ and copies it to the src/content/commands/en-US/ directory. The HagiCode team discovered in practice that after each synchronization, the command catalog needs to be regenerated, otherwise content inconsistency issues will occur.
Multilingual maintenance
Maintain multilingual text for the site interface:
# Check translation completenessenv -u NPM_CONFIG_PREFIX npm run i18n:audit
# Synchronize translation entriesenv -u NPM_CONFIG_PREFIX npm run i18n:sync
# Clean up outdated translationsenv -u NPM_CONFIG_PREFIX npm run i18n:prune
# Diagnose translation issuesenv -u NPM_CONFIG_PREFIX npm run i18n:doctorTranslation files are located in the src/i18n/locales/ directory:
src/i18n/locales/├── en-US/│ ├── common.yml│ └── docs.yml└── zh-CN/ ├── common.yml └── docs.ymlYAML file example:
commands: title: "Commands" subtitle: "Explore the complete command surface" overview: "Overview" related: "Related Commands"
# src/i18n/locales/zh-CN/docs.ymlcommands: title: "命令" subtitle: "探索完整的命令集" overview: "概览" related: "相关命令"Using impeccable commands
In the HagiCode project, you can call impeccable commands in the following ways:
# Design new featuresnpx impeccable craft "user settings page"
# Plan UI/UXnpx impeccable shape "checkout flow"
# Set project contextnpx impeccable teach
# Generate design documentationnpx impeccable document
# Review design qualitynpx impeccable critique "landing page"
# Technical quality checknpx impeccable audit "navigation component"
# Final optimizationnpx impeccable polish "onboarding flow"
# Real-time iterative designnpx impeccable liveEach command has specific purposes and reference documentation. For example, the craft command is used for end-to-end feature building, including UX/UI planning and code implementation; the audit command is used for technical quality checking, including accessibility, performance, and responsive design. In the HagiCode team’s development process, these commands have become part of the daily development workflow.
Deployment validation
Perform complete validation before deployment:
# Run complete validation processenv -u NPM_CONFIG_PREFIX npm run validateThe validation process will check:
- Whether the vendor path is correct
- All commands have corresponding content in both Chinese and English directories
- Generated multilingual resources are up to date
- Command catalog is up to date
- Astro routes compile correctly
- Static output builds successfully
Important Notes and Best Practices
Important notes
-
Submodule updates: After updating the submodule, you need to regenerate derived resources and commit. The HagiCode team once encountered a situation where they committed directly without regenerating resources, causing content inconsistency issues on the production site.
-
Language equivalence: Ensure all commands have corresponding content in both Chinese and English directories, otherwise the build will fail. This check has been integrated into the validation process, allowing issues to be discovered early in development.
-
Frontend proxy: impeccable-site is proxied through the static site development script in the monorepo root directory:
# Start from monorepo root directorynpm run dev:static-sites-
Production deployment: The production site is deployed to
https://impeccable.hagicode.com, automated through GitHub Actions. HagiCode adopts a fully automated CI/CD process to ensure each commit is automatically deployed. -
Command documentation links: When selecting an impeccable command in the Web frontend’s UI Master, the corresponding documentation link will be displayed, with the link format:
https://impeccable.hagicode.com/{lang}/commands/{command-name}Best practices summary
-
Regularly synchronize upstream: Pay attention to upstream impeccable updates and regularly synchronize new commands and improvements. The HagiCode team adopts a weekly synchronization frequency to ensure important updates are not missed.
-
Maintain localized content: After synchronizing upstream content, update Chinese and English documentation in a timely manner to ensure content accuracy and timeliness.
-
Version control: After submodule updates, verify build results before committing to the version control system.
-
Team collaboration: Support team members in collaboratively maintaining documentation content through standardized multilingual workflows.
-
Quality assurance: Run complete validation processes after each content update to ensure site correctness.
-
Command classification usage: Choose appropriate command categories based on different stages of design tasks:
- Use
craftorshapewhen designing new features - Use
critiqueorauditwhen reviewing existing designs - Use
polish,bolder, orquieterwhen optimizing design quality - Use
animate,colorize, ordelightwhen enhancing visual effects - Use
clarify,adapt, oroptimizewhen fixing issues - Use
livefor real-time iteration
- Use
-
Context management: Before using the
craftcommand, ensure that the project’s PRODUCT.md and DESIGN.md context files have been set up through theteachcommand.
Summary
Through the above integration and usage methods, the HagiCode project can effectively leverage impeccable’s professional design capabilities to improve product UI/UX quality, while establishing standardized documentation maintenance processes to support long-term team collaboration and development.
The solution shared in this article was optimized through multiple iterations in HagiCode’s actual development. It not only solved the design-development collaboration problem but also established an extensible documentation system, providing a reference for integrating other tools.
If you also face similar design-development collaboration issues in your team, I hope the practices in this article provide you with some inspiration. The core idea of this solution is: establish standardized processes, maintain synchronization with upstream, focus on localized maintenance, and support team collaboration.
Summary
Regarding “how to integrate and use impeccable,” a more prudent approach is to gradually get the key configurations, dependency boundaries, and implementation paths working first, then fill in the optimization details.
When goals, steps, and acceptance criteria are clearly defined, such solutions can usually proceed more smoothly into actual delivery.
开始使用 HagiCode
一次安装,几分钟上手
HagiCode for Windows 在 Microsoft Store 免费提供。打开商店即可安装并保持更新;也可以先对比各版本与定价,再决定从哪个渠道开始。
Ecosystem Sites
Quick Links
Community
© 2026 HagiCode | Powered By hagilight-starlight@0.6.1