Building & Compiling
Relevant source files
The following files were used as context for generating this wiki page:
- bundled-skills/wiki-vitepress/SKILL.md
- bundled-skills/wiki-onboarding/SKILL.md
- bundled-skills/codebase-audit-pre-push/SKILL.md
- bundled-skills/skill-creator/SKILL.md
- bundled-skills/systems-programming-rust-project/SKILL.md
- bundled-skills/documentation-generation-doc-generate/resources/implementation-playbook.md
Building and compiling within the OpenCode Skills Collection refers to the automated processes used to transform source code, markdown documentation, and skill definitions into executable artifacts or polished static sites. This system encompasses multiple languages and frameworks, primarily focusing on TypeScript/JavaScript for web-based documentation sites and Rust for systems-level applications.
The project utilizes specific build tools like VitePress for documentation rendering and Cargo for Rust compilation. It also incorporates pre-build validation steps, such as codebase audits and YAML frontmatter checks, to ensure production readiness before the final build artifacts are generated.
Sources: bundled-skills/wiki-vitepress/SKILL.md, bundled-skills/systems-programming-rust-project/SKILL.md, bundled-skills/codebase-audit-pre-push/SKILL.md
VitePress Static Site Generation
The project employs VitePress to transform Markdown wiki pages into a browsable HTML site. This process involves scaffolding a specific directory structure and configuring a dark-themed environment with integrated Mermaid diagram support.
Build Workflow
The build process for the documentation site follows a sequence of scaffolding, configuration, and execution.
The documentation build process requires pre-processing scans to fix Vue template compatibility issues, such as replacing <br/> with <br> and escaping bare generic parameters.
Sources: bundled-skills/wiki-vitepress/SKILL.md:12-20, bundled-skills/wiki-vitepress/SKILL.md:73-82
Configuration Elements
| Component | Purpose | Key Settings |
|---|---|---|
config.mts | Main Site Config | appearance: 'dark', withMermaid wrapper |
package.json | Build Scripts | docs:build command |
theme/index.ts | Dynamic Styling | onMounted hooks for Mermaid SVG fixes |
| Sources: bundled-skills/wiki-vitepress/SKILL.md:22-30, bundled-skills/wiki-vitepress/SKILL.md:50-65 |
Rust Project Compilation
For systems-level components, the project defines a standardized compilation and scaffolding architecture using the Cargo toolchain. This includes support for various project types including Binaries, Libraries, and Workspaces.
Cargo Build Pipeline
The compilation of Rust projects is managed through Cargo.toml configurations which define optimization levels and code generation units.
In release profiles, the system is configured for maximum performance using Link Time Optimization (LTO) and restricted codegen units to enhance cross-module optimizations.
Sources: bundled-skills/systems-programming-rust-project/SKILL.md:47-53, bundled-skills/systems-programming-rust-project/SKILL.md:158-160
Build Commands
| Task | Command | Description |
|---|---|---|
| Build | cargo build | Compiles the current package |
| Run | cargo run | Compiles and runs the binary |
| Test | cargo test | Executes unit and integration tests |
| Bench | cargo bench | Runs defined benchmarks |
| Sources: bundled-skills/systems-programming-rust-project/SKILL.md:213-231 |
Automation & Validation
The build system incorporates automated validation phases that occur before or during the compilation of new "skills." This ensures that metadata and code structures adhere to project standards.
Skill Creation and Installation
When creating new skills, a multi-phase workflow automates file generation and local/global installation via symlinks.
The validation scripts check for YAML frontmatter completeness and word count limits (ideally between 1,500 and 2,000 words) before allowing the skill to be "installed" into the local environment.
Sources: bundled-skills/skill-creator/SKILL.md:65-75, bundled-skills/skill-creator/SKILL.md:188-210, bundled-skills/skill-creator/SKILL.md:248-255
Continuous Integration (CI) Patterns
The project utilizes GitHub Actions to automate documentation generation and deployment. The workflow typically involves:
- Setting up the language environment (e.g., Python 3.11).
- Installing documentation-specific dependencies.
- Generating OpenAPI specifications from source code.
- Building static HTML using tools like Redocly or Sphinx.
- Deploying the build directory to hosting platforms like GitHub Pages.
Sources: bundled-skills/documentation-generation-doc-generate/resources/implementation-playbook.md:237-268
Pre-Push Audit & Security
A critical component of the "Compiling" phase is the pre-push audit, which acts as a quality gate for production readiness. This process scans for secrets, dead code, and injection vulnerabilities.
Audit Checklist
| Category | Check Items |
|---|---|
| Secrets | .env files, API keys, private keys |
| Dead Code | Unused imports, commented-out blocks, unreachable code |
| Security | SQL injection risks, hardcoded passwords |
| Artifacts | node_modules/, dist/, build/ (to be removed) |
| Sources: bundled-skills/codebase-audit-pre-push/SKILL.md:28-48, bundled-skills/codebase-audit-pre-push/SKILL.md:56-65 |
Summary
The Building & Compiling infrastructure in this project is a hybrid system that integrates documentation rendering, systems-level compilation, and rigorous pre-flight validation. By combining VitePress for web output, Cargo for Rust binaries, and custom shell scripts for skill metadata validation, the project maintains a high standard of code quality and documentation accuracy. The use of CI/CD pipelines further ensures that architectural artifacts like OpenAPI specs and C4 diagrams remain synchronized with the underlying source code.