mirror of
https://github.com/zernie/vigiles.git
synced 2026-09-14 20:53:57 +08:00
3b81e5042b
Spec: context:fork + gated forked-skill output, agent color/disallowedTools, dir()/glob(), didNotWrite(), scaffold-test, section length-guard, migrate->adopt-spec. Docs: docs/spec-format.md completed + docs/railway-subagents.md + research/spec-syntax-and-railway-scope.md decisions. Testing harness: parseSubagents recovers --plugin-dir subagent nested-traces (namespaced subagent_type + the sub's returned result() block). Evals (real-model): caveman debunk hardened on sonnet (-23%/-20%); the does-our-spec-help A/B validated the spec HELPS (parseable outcome 0%->100%, no quality regression).
4.1 KiB
4.1 KiB
Contributing to vigiles
Thanks for your interest in contributing! This guide covers everything you need to get started.
Prerequisites
- Node.js 20+
- npm 10+
- For full test coverage, you'll also need these linter CLIs on your PATH:
ruffandpylint(Python)rubocop(Ruby)cargowithclippy(Rust)
Setup
git clone https://github.com/zernie/vigiles.git
cd vigiles
npm install
npm run build
Project structure
src/
types.ts Type definitions (interfaces, type aliases)
validate.ts Core validation engine (parsing, config, linter checks)
action.ts GitHub Action wrapper (reads env vars, calls validatePaths)
cli.ts CLI entry point (arg parsing, output formatting)
validate.test.ts Test suite (node:test)
schemas/ Built-in mdschema YAML presets
skills/ Shipped consumer skills (test-harness, adopt-spec, strengthen, edit-spec, linter-docs)
dev/skills/ Internal dev-only skills, NOT shipped (generate-logo, pr-to-lint-rule, enforce-rules-format, audit-feedback-loop)
dist/ Compiled JavaScript output (git-ignored)
Development workflow
Build
npm run build # Compile TypeScript → dist/
Test
npm test # Build + run all tests
Tests use Node.js built-in test runner (node:test) and node:assert/strict. No extra test framework needed.
Format
npm run fmt # Auto-format with Prettier
npm run fmt:check # Check formatting (CI uses this)
Type check
npx tsc --noEmit # Type-check without emitting
Run locally
npx vigiles CLAUDE.md # Validate a file
npx vigiles --markers=headings,checkboxes . # Custom markers
npx vigiles # Auto-discover instruction files
TypeScript conventions
This project uses TypeScript strict mode with these compiler options enabled:
strict: true(includesstrictNullChecks,noImplicitAny, etc.)noUncheckedIndexedAccess: truenoUnusedLocals: truenoUnusedParameters: true
Guidelines
- Explicit types on all exported function signatures (parameters and return types).
- No
any— useunknownand narrow with type guards when the type is truly unknown. - Import types with
import type { ... }when only used in type positions. - Use
.jsextensions in import paths (required by Node16 module resolution). - Keep the single-file core architecture —
validate.tscontains all validation logic.
Adding a new validation rule
- Add the rule name and default value to
RulesConfiginsrc/types.ts. - Add the default to
RULE_PACKSinsrc/validate.ts. - Implement the check inside the
validate()function. - Add tests in
src/validate.test.ts. - Document the rule in
README.mdandCLAUDE.md.
Adding a new linter resolver
- Add a Node API resolver to
LINTER_RESOLVERS(if the linter has a Node API). - Or add a CLI checker to
CLI_RULE_CHECKSand map it inCLI_TOOL_FOR_LINTER. - Optionally add a config-enabled checker to
LINTER_CONFIG_CHECKERS. - Add tests covering both existing and nonexistent rules.
Pull requests
- Keep PRs focused — one feature or fix per PR.
- All tests must pass (
npm test). - Code must compile without errors (
npx tsc --noEmit). - Code must be formatted (
npm run fmt:check). - Update
CLAUDE.mdif you change exported APIs or add new rules. - Write descriptive commit messages explaining why, not just what.
Architecture decisions
- Single-file core: All validation logic lives in
validate.tsfor portability and minimal dependency surface. - Zero config by default: vigiles works out of the box. Config exists only for overrides.
- Two rule packs:
"recommended"(permissive defaults) and"strict"(tighter constraints). - Linter auto-detection: No need to declare which linters you use — vigiles discovers them.
- Agent auto-discovery: Detects AI coding tools by their config directories and validates their instruction files exist.