zcf / tests
CLAUDE.md6.1k starsChanged 15 months agoMITView on GitHub
Last Updated: Mon Oct 27 19:39:26 CST 2025 Root > tests Test suite module providing comprehensive test coverage for the ZCF project, including unit tests, integration tests, edge tests, and template validation tests.
Trending
More talk lately.about the whole repository
Who's talking about UfoMiao/zcf
- code-yeongyu/oh-my-openagent“[Feature]: MCP API should have free alternatives”GitHub · Jan 10, 2026 · 2 reactions
- Lapis0x0/obsidian-yolo“[Feature Request]: Adding BMAD or Spec "kits" to the repo”GitHub · Sep 11, 2025 · 1 reactions
- sudosubin/agents.nix“agent-skills.github.ufomiao.zcf: init at 3.7.3”GitHub · Oct 3, 2026
- zhycn/learning-by-output“[AI Coding] ZCF(Zero-Config Code Flow)安装与使用向导”GitHub · Feb 13, 2026
- nguyenphutrong/quotio“Ollama and MLX Support”GitHub · Jan 28, 2026
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub (15 times).
On GitHub · 15
- Jan 10, 2026[Feature]: MCP API should have free alternatives — code-yeongyu/oh-my-openagent2 reactions · 10 comments
- Sep 11, 2025[Feature Request]: Adding BMAD or Spec "kits" to the repo — Lapis0x0/obsidian-yolo1 reaction · 2 comments
- Oct 3, 2026agent-skills.github.ufomiao.zcf: init at 3.7.3 — sudosubin/agents.nix0 reactions
- Feb 13, 2026[AI Coding] ZCF(Zero-Config Code Flow)安装与使用向导 — zhycn/learning-by-output0 reactions
- Jan 28, 2026Ollama and MLX Support — nguyenphutrong/quotio0 reactions
10 more on GitHub
- Jan 10, 2026Q: Considerations of other MCPs — agiletec-inc/airis-mcp-gateway0 reactions · 3 comments
- Dec 24, 2025[Question] ZCF compatibility — jeremylongshore/tons-of-skills-marketplace0 reactions · 3 comments
- Dec 16, 2025Can this be turned into an MCP? — hluaguo/learn-faster-kit0 reactions · 1 comment
- Dec 16, 2025Claude Code Router Compatibility — Spacehunterz/Emergent-Learning-Framework_ELF0 reactions
- Oct 26, 2025serena - activate_project Search the superior directory — oraios/serena0 reactions · 2 comments
- Oct 18, 2025Could this be turned into a portable DB? — gannonh/memento-mcp0 reactions · 2 comments
- Oct 6, 2025Are you guys ZCF-compatible? — snahrup/bmad-agent-windsurf0 reactions
- Oct 3, 2025Can Agents use JJ for version control? — agent-era/devteam0 reactions
- Aug 25, 2025Use Qwen? — ammaarreshi/Gemini-Search0 reactions
- Aug 25, 2025CCR can't use Gemini to fetch website — musistudio/claude-code-router0 reactions · 4 comments
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- zcf-add-sponsorSkill
- zcf-prSkill
- zcf-releaseSkill
- zcf-update-docsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Test suite module providing comprehensive test coverage for the ZCF project, including unit tests, integration tests, edge tests, and …
- Distinctive: line 83
Mock: All external dependencies
- Distinctive: line 275
Create test file in appropriate directory
- Distinctive: line 276
Use standard Mock strategy
- Distinctive: line 277
Ensure test covers all branches of new functionality
- Very specific: line 281
Use async/await and Vitest's async test support, ensuring async operations complete before assertions.
- Distinctive: line 293
Add boundary condition tests
- Distinctive: line 295
Verify exception handling logic
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tests Module
Last Updated: Mon Oct 27 19:39:26 CST 2025 Root > tests
Module Responsibilities
Test suite module providing comprehensive test coverage for the ZCF project, including unit tests, integration tests, edge tests, and template validation tests.
Entry Points and Startup
- Testing Framework: Vitest
- Coverage Tool: @vitest/coverage-v8
- Test UI: @vitest/ui
- Main Test Directories:
tests/- New test suitestest/unit/- Unit teststest/integration/- Integration tests
External Interfaces
Test Architecture
tests/
├── commands/ # Command layer tests
│ ├── *.test.ts # Core command tests
│ └── *.edge.test.ts # Command edge tests
├── utils/ # Utility layer tests
│ ├── ccr/ # CCR tool tests
│ ├── cometix/ # Cometix tool tests
│ └── tools/ # Third-party tool integration tests
├── config/ # Configuration system tests
├── i18n/ # Internationalization tests
└── templates/ # Template validation tests
test/
├── unit/ # Unit test suites
│ ├── commands/ # Command unit tests
│ ├── utils/ # Utility unit tests
│ └── config/ # Configuration unit tests
├── integration/ # Integration tests
└── helpers/ # Test helper toolsTest Tool Interface
// Test helper functions
export function mockFileSystem(): void
export function mockUserInput(responses: string[]): void
export function mockPlatform(platform: 'windows' | 'macos' | 'linux'): void
export function mockCommandExecution(commands: Record<string, string>): void
// Test validation tools
export function validateConfig(config: any): boolean
export function validateWorkflowInstallation(result: WorkflowInstallResult): booleanKey Dependencies and Configuration
Testing Framework Configuration
- Vitest: Main testing framework supporting TypeScript and ESM
- Coverage: V8 coverage reporting with 80%+ target
- UI: Visual testing interface
- Mock System: Comprehensive mocking system
Test Configuration Files
vitest.config.ts- Vitest main configurationtest/helpers/- Test helper tools- Mock strategies distributed across test files
Test Data Models
Test Layering Strategy
1. Unit Test Layer (test/unit/)
- Scope: Individual function or class behavior
- Isolation: Completely isolated test environment
- Mock: All external dependencies
2. Integration Test Layer (test/integration/)
- Scope: Multi-module interaction
- Dependencies: Allow real module interaction
- Validation: End-to-end functionality verification
3. Edge Test Layer (*.edge.test.ts)
- Scope: Error conditions and boundary cases
- Coverage: Exception handling and extreme inputs
- Validation: Error recovery and graceful degradation
4. New Test Suite (tests/)
- Scope: New features and refactoring tests
- Organization: Organized by functional modules
- Standards: Higher testing standards
Test Coverage Analysis
Command Layer Test Coverage
✅ Init Command Tests
- File:
test/unit/commands/init.test.ts(29 line configuration) - Edge:
init.edge.test.ts- Error scenarios - Skip Prompt:
init-skip-prompt.test.ts- Non-interactive mode - Coverage: High - Complete initialization flow
✅ Menu Command Tests
- File:
test/unit/commands/menu.test.ts(40 line configuration) - Function: Interactive menu logic validation
- Mock: User input and menu navigation
✅ CCR Command Tests
- File:
tests/commands/ccr.test.ts,ccr.edge.test.ts - Function: Claude Code Router configuration
- Edge: Installation failures and configuration errors
✅ CCU Command Tests
- File:
tests/commands/ccu.test.ts,ccu.edge.test.ts - Function: CCusage tool integration
- Edge: Command execution failures
✅ Update Command Tests
- File:
test/unit/commands/update.test.ts(24 line configuration) - Function: Workflow update mechanism
Utility Layer Test Coverage
✅ Configuration Management Tests
- File:
test/unit/utils/config.test.ts(10 line reference) - Function: Configuration read/write, backup, merge
- Mock: File system operations
✅ MCP Service Tests
- File:
test/unit/utils/mcp.test.ts(9 line reference) - Function: MCP service configuration and management
- Platform: Windows special handling
✅ Platform Compatibility Tests
- File:
test/unit/utils/platform.test.ts - Function: Cross-platform detection and handling
- Mock: Operating system environment
✅ Workflow Installation Tests
- File:
test/unit/utils/workflow-installer.test.ts(20 line configuration) - Function: Workflow installation and dependency resolution
✅ CCR Toolset Tests
- Directory:
tests/utils/ccr/ - Files:
config.test.ts,installer.test.ts,presets.test.ts - Edge: Corresponding
.edge.test.tsfiles
✅ Cometix Toolset Tests
- Directory:
tests/utils/cometix/ - Files:
installer.test.ts,menu.test.ts,commands.test.ts - Function: CCometixLine statusbar tool
System-Level Test Coverage
✅ Internationalization Tests
- File:
tests/i18n/locales/workflow.test.ts - Function: Translation completeness and consistency verification
✅ Workflow Configuration Tests
- File:
tests/config/workflows.test.ts - Edge:
test/unit/config/workflows.edge.test.ts - Function: Workflow configuration validation
✅ Template Validation Tests
- File:
tests/templates/chinese-templates.test.ts - Function: Chinese template completeness verification
Quality Metrics and Strategy
Coverage Targets
- Line Coverage: 80%+ (configured in vitest.config.ts)
- Function Coverage: 80%+
- Branch Coverage: 80%+
- Statement Coverage: 80%+
Mock Strategy
✅ File System Mock
// Mock file operations
vi.mock('node:fs', () => ({
existsSync: vi.fn(),
readFileSync: vi.fn(),
writeFileSync: vi.fn()
}))✅ Command Execution Mock
// Mock external commands
vi.mock('tinyexec', () => ({
$: vi.fn()
}))✅ User Input Mock
// Mock interactive prompts
vi.mock('inquirer', () => ({
prompt: vi.fn()
}))✅ Platform Detection Mock
// Mock platform environment
vi.mock('../utils/platform', () => ({
getPlatform: vi.fn(),
isWindows: vi.fn()
}))Test Execution and Reporting
Test Commands
# Run all tests
pnpm test
# Watch mode
pnpm test:watch
# UI interface
pnpm test:ui
# Coverage report
pnpm test:coverage
# Single run
pnpm test:runTest Organization
- Grouped by Function: Commands, utilities, configuration tested separately
- Layered Testing: Unit, integration, edge three-layer coverage
- Platform Testing: Cross-platform compatibility verification
- Regression Testing: Prevent feature regression
FAQ
Q: How to add new tests?
- Determine test type (unit/integration/edge)
- Create test file in appropriate directory
- Use standard Mock strategy
- Ensure test covers all branches of new functionality
Q: How to handle async tests?
Use async/await and Vitest's async test support, ensuring async operations complete before assertions.
Q: How to choose Mock strategy?
- File system operations must be mocked
- External command execution must be mocked
- User interaction must be mocked
- Platform detection can be mocked for multi-platform testing
Q: How to improve test coverage?
- Identify uncovered code branches
- Add boundary condition tests
- Increase error scenario tests
- Verify exception handling logic
Related File List
Core Test Suites
Unit Tests (test/unit/)
commands/- Command layer unit tests (8 files)utils/- Utility layer unit tests (25 files)config/- Configuration system tests (3 files)cli-*.test.ts- CLI system tests (3 files)
New Test Suite (tests/)
commands/- Command tests (4 files)utils/ccr/- CCR tool tests (6 files)utils/cometix/- Cometix tests (3 files)utils/tools/- Tool integration tests (1 file)config/- Configuration tests (1 file)i18n/- Internationalization tests (1 file)templates/- Template tests (1 file)
Integration Tests (test/integration/)
statusline-config.test.ts- Statusbar configuration integrationtest-helpers.ts- Integration test helpers
Test Helpers (test/helpers/)
statusline-helpers.ts- Statusbar test helpers
Statistics
- Total Test Files: 60+ files
- Test Distribution:
- Unit tests: 80%
- Integration tests: 10%
- Edge tests: 10%
- Platform Coverage: Windows/macOS/Linux/Termux
Changelog
2025-08-20
- Module Documentation Created: Completed comprehensive documentation of tests module
- Test Architecture Analysis: Detailed analysis of 60+ test files' organizational structure
- Coverage Assessment: Confirmed 80%+ high coverage target
- Mock Strategy Documentation: Complete recording of test mocking strategies and best practices
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

