2.3 KiB
2.3 KiB
Repository Guidelines
Note: See CLAUDE.md for comprehensive project documentation. This file provides a quick reference for common patterns.
Project Structure
src/cmdforge/- Core Python package (CLI, tool model, runner, providers, GUI)tests/- Pytest test suitesdocs/- Infrastructure and deployment documentation
Development Commands
pip install -e ".[dev]" # Install in dev mode
pytest tests/ -m "not integration" # Run unit tests
cmdforge # Launch GUI
cf # Interactive tool picker
Architecture Quick Reference
cli/- Routes all subcommands (list, create, run, test, providers, registry, collections, deps, install, etc.)tool.py- Tool/step dataclasses, including delegatedToolStepcontext andMcpSteppreflight.py- Shared contract, dependency, secret-pattern, and registry-similarity analysiscontract_testing.py- Deterministic JSON Schema input generation and side-effect-safe conformance checksrunner.py- Step execution, variable substitution, nested authorization and delegationproviders.py- AI providers, auto-discovery, fallback chains, and tool/MCP allowlistsskills.py- Per-provider Agent Skills loading and validationmcp_client.py,mcp_server.py- Stdio MCP client/server supportgui/- PySide6 desktop GUI with page-based navigationweb/- Flask web UI and forumregistry/- Flask registry API (search, publish, moderation)
Coding Style
- Python: 4-space indentation,
snake_casefor modules/variables - CLI tools: lowercase with hyphens (e.g.,
fix-grammar,json-extract) - Follow Unix pipe philosophy: composable tools with stdin/stdout
Testing
- Framework:
pytest(seepyproject.toml) - Test files:
tests/test_*.py - Use
mockprovider or--dry-runto avoid network calls - Use
cmdforge inspect <tool>for deterministic local preflight checks - Integration tests require
@pytest.mark.integrationdecorator
Commit Guidelines
- Short, imperative, sentence-case subjects (e.g., "Add provider validation")
- Include test results or rationale if skipped
- Add screenshots for UI changes
Security
- Provider configs:
~/.cmdforge/providers.yaml(never commit) - Tool configs:
~/.cmdforge/<toolname>/config.yaml(user data, never commit)