Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

Β 

History

566 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SpecSync

GitHub Marketplace spec coverage CI Crates.io Downloads License: MIT

Turn requirements into module contracts that fail CI when code driftsβ€”without losing the decisions and evidence around the fix.

Rust Β· single binary Β· 33 languages Β· no SpecSync API key required

Quick start Β· Verified change workflow Β· Live documentation Β· Examples Β· Comparisons


A contract change in 60 seconds

Start with product intent in specs/auth/requirements.md:

### REQ-auth-004
The system SHALL let a signed-in user revoke every active session.

Refine it into the durable module contract in specs/auth/auth.spec.md:

| Name | Kind | Description |
|---|---|---|
| `revoke_all_sessions` | function | Revokes every session owned by the current user. |

Now a developer adds a second public export without updating the contract:

pub fn revoke_all_sessions(user_id: UserId) -> Result<usize, SessionError> { /* ... */ }
pub fn revoke_session(session_id: SessionId) -> Result<(), SessionError> { /* new */ }

The same check runs locally and in CI:

$ specsync check --strict
specs/auth/auth.spec.md
  βœ“ Frontmatter valid
  βœ“ All source files exist
  βœ“ All required sections present
  ⚠ 1/2 exports documented
  ⚠ Undocumented export 'revoke_session' from src/auth.rs
  βœ“ All dependency specs exist

1 specs checked: 1 passed, 2 warning(s), 0 failed
File coverage: 1/1 (100%)
LOC coverage:  2/2 (100%)

--strict mode: 2 warning(s) treated as errors

The fix preserves more than a generated document:

requirements.md  why the behavior exists and how success is judged
auth.spec.md      the module/API contract checked against code
context.md        decisions, constraints, and files the next agent needs
testing.md        requirement-to-test evidence
<change-id>/      approved deltas, verification, and the delivery audit trail

Add the missing contract rowβ€”or make the export privateβ€”then rerun the check. CI turns green while the requirement, context, evidence, and exact contract change remain reviewable in Git.

Read the adversarial proof

What SpecSync catches

SpecSync validates Markdown module specs (*.spec.md) against source code in both directions.

Drift Result
Code exports something absent from its spec Warning; fails in strict mode
A spec documents an export missing from code Error
A referenced source file was deleted Error
A required spec section is missing Error
A declared dependency does not exist Error
A source import is undeclared Strict dependency error
A documented database table or column is missing Error
A schema column is undocumented or has a type mismatch Warning

It also provides a verified spec-driven development lifecycle, coverage gates, quality scoring, dependency analysis, cross-project references, Git hooks, editor integration, and agent-native workflows.

SpecSync's core is deterministic and local. It does not require a hosted SpecSync service, Corvid AI account, provider key, or embedded model. Claude, Cursor, Codex, Gemini, and other coding agents use the same CLI and lifecycle through their own permissions.

A successful structural check does not prove arbitrary natural-language behavior or execute product tests. Reviewers and product tests establish those behaviors; keep those checks in CI.

Verified change workflow

SpecSync 6.0 keeps one change package and one user-facing path from scope to merge:

specsync change new "Add passkeys" --spec auth --path src/auth.rs --json
specsync change answer add-passkeys acceptance_criteria \
  "A registered passkey authenticates the user" --json
# answer the remaining interview questions and complete the selected artifacts/deltas
specsync change approve add-passkeys --actor "Ada"

# implement the approved contract and run product tests
specsync change check add-passkeys --commit
# push after local gates; wait for required CI and complete human implementation review
specsync change review add-passkeys --reviewer "Ada"
specsync change finalize add-passkeys
# no commit between review and finalize; commit/push the archive, wait for CI, then merge

The scope approval binds human-approved content. The reviewer may be that same person. Actor/reviewer labels and stored provider declarations are claims, not authenticated identity; configure hosted checks and signed provenance policy separately when authentication is required. change check materializes approved deltas and records scoped structural verification; it does not execute project tests. finalize archives the package on the same PR. Merge only after all active changes on the PR are archived. Use change status for eligible recovery, including workflow-v2 reopen when accepted or archived evidence becomes stale.

Read the workflow guide or run the complete lifecycle example.

Install

GitHub Releases, crates.io, and Homebrew (CorvidLabs/tap/spec-sync) all serve 6.0.0. Confirm what you received with specsync --version, and pin all lifecycle writers and CI to the same 6.x version.

Cargo

cargo install specsync

Homebrew

brew install CorvidLabs/tap/spec-sync

GitHub Action

- uses: CorvidLabs/spec-sync@v6.0.0
  with:
    version: '6.0.0'
    strict: 'true'
    require-coverage: '100'

Prefer the immutable @v6.0.0 Action and binary pins shown above for release gates. Always pass version: '6.0.0' with that tag: @v6.0.0 still defaults the download to 6.0.0-rc.14. The floating @v6 tag is published; its omitted-input default is 6.0.0. YAML examples keep the immutable pin.

Minimal immutable configuration:

- uses: CorvidLabs/spec-sync@v6.0.0
  with:
    version: '6.0.0'

Pre-built binaries

Download Linux or macOS binaries from GitHub Releases.

Windows is not a supported target as of 6.0 β€” no Windows binary is published. Run SpecSync under WSL, or build it from source with cargo install specsync.

Quick start

# Initialize configuration with the change workflow off
specsync init

# Write a source file first so the scaffold can bind it
mkdir -p src
cat > src/auth.ts <<'EOF'
export function login(): boolean {
  return true;
}
EOF

# Scaffold a module contract and companion files
specsync add-spec auth

# Validate. A fresh scaffold still has stub sections, so this is a warning
# pass β€” fill Purpose, Invariants, examples, and errors before `--strict`.
specsync check

# Measure coverage and spec quality
specsync coverage
specsync score --all

# Install native coding-agent workflows and Git hooks
specsync agents install
specsync hooks install

For an existing 4.x project, use the guided migration and adoption flow described in the configuration and workflow guides.

Specs and companion files

Each module keeps one executable contract and focused context beside it:

specs/auth/
β”œβ”€β”€ auth.spec.md      validated module contract
β”œβ”€β”€ requirements.md  stable requirements and acceptance criteria
β”œβ”€β”€ tasks.md         active work, roadmap, and test debt
β”œβ”€β”€ context.md       architectural decisions and current state
└── testing.md       automated, manual, and edge-case evidence
Artifact Durable responsibility
*.spec.md Source files, public API, invariants, behavior, errors, dependencies, and change history
requirements.md Stable REQ-* identities, normative SHALL statements, and acceptance criteria
tasks.md Work still to do; requirements are not checkboxes
context.md Decisions, constraints, key files, and handoff state
testing.md Requirement traceability, automated coverage, manual QA, and adversarial cases
.specsync/changes/<change-id>/ Proposed deltas, approvals, verification, and closing evidence

Read the complete spec format, companion-file reference, and workflow conventions.

Documentation

Start here Reference and integration
Why SpecSync? CLI reference
Quick start Configuration
Workflow guide Spec format
Companion files Language registry
Architecture Cross-project references
AI and coding agents GitHub Action
Live docs hub VS Code extension

Executable examples

The examples create disposable projects and run the real CLI:

How it compares

SpecSync can stand alone or enforce the implementation layer beneath planning-oriented tools:

Supported languages

SpecSync auto-detects source files and public exports across 33 languages:

TypeScript/JavaScript, Rust, Go, Python, Swift, Kotlin, Java, C#, Dart, PHP, Ruby, YAML, C, C++, Scala, Crystal, Nim, Erlang, Elixir, Perl, Common Lisp, Scheme, Emacs Lisp, Haskell, Lua, R, OCaml, Groovy, F#, Clojure, D, Objective-C, Bash, PowerShell, and Vala.

See the detailed language profiles for 12 representative stacks and the extractor source for exact support, export detection, and test exclusions across all 33 families.

Contributing

Contributions are welcome. Read CONTRIBUTING.md, run the relevant tests, and keep specs synchronized with public behavior.

Security issues should follow SECURITY.md, not a public issue.

License

MIT β€” see LICENSE.

About

πŸ“ Bidirectional spec-to-code drift detection. Rust CLI and MCP server that catches undocumented exports and vanished symbols in CI.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages