Sign In

@imix-js/taproot

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imix-js/taproot

AI-driven specs, enforced at commit time. Code without traceability doesn't merge.

Source
npmnpm
Version
0.9.5
Version published
Weekly downloads
66
2100%
Maintainers
1
Weekly downloads
 
Created
Source

Taproot

Taproot demo — npx taproot init, /tr-ineed, taproot dod

AI-driven specs, enforced at commit time. Code without traceability doesn't merge.

AI coding agents generate code fast — but six months later, nobody knows why a module exists, who asked for it, or whether it's still needed. The requirement lived in a chat window. The chat window is gone.

Taproot keeps requirements as first-class files in your repo. The agent writes the spec, writes the code, and git refuses to accept one without the other.

Quick Start

npx @imix-js/taproot init        # installs agent adapter + pre-commit hook

Then in your agent:

/tr-ineed user authentication    # describe a requirement → spec written + placed
/tr-implement taproot/auth/      # implement it: code + tests + traceability, committed

That's the loop. Spec first, code second, git enforces both.

Planning a batch of work:

/tr-plan                         # build a prioritised plan from backlog + unimplemented specs
/tr-plan-execute                 # run through it — autonomous items execute; HITL items pause for you

Describe ten requirements, review the plan, walk away. When you return, everything autonomous is done and the human decisions are waiting.

/tr-guide     ← onboarding walkthrough
/tr-status    ← health dashboard: coverage, orphans, stale specs
/tr-discover  ← reverse-engineer an existing codebase into taproot

Full workflow guide: docs/workflows.md

How enforcement works

taproot init installs a pre-commit hook. It runs automatically on every git commit — no commands to invoke:

Commit typeGateWhat it checks
Declaring a new impl (impl.md only)DoR — Definition of ReadyBehaviour spec is specified; required sections present; custom conditions in settings.yaml
Committing source codeDoD — Definition of DoneTests pass; all configured conditions resolved and recorded
Committing specs (intent.md, usecase.md)Truth checkStaged specs are consistent with taproot/global-truths/

Code that fails these checks doesn't reach the repo.

Concepts

Already know what Intent, Behaviour, and Implementation mean? Jump to Why it matters ↓

Intent — the business goal behind a feature, written from a user perspective. Example: password-resetAllow users to recover access to their account

Behaviour — one observable, testable thing the system does for a specific actor. Example: request-resetUser submits their email; system sends a reset link

Implementation — the code that satisfies a behaviour, with a traceable link back to the spec. Example: email-trigger/impl.md lists the source files and the commit that built them

Global truth — a project-wide fact enforced at every commit (business rule, entity definition, project convention), stored in taproot/global-truths/. Example: prices are always exclusive of VAT — a spec that contradicts this is blocked before it merges

Backlog — a lightweight scratchpad for ideas and deferred work captured mid-session, stored in taproot/agent/backlog.md — separate from the requirement hierarchy. Example: /tr-backlog "consider a caching layer" captures the thought without interrupting flow

Further reading

Why it matters

  • Ask "why does this code exist?" and get a structured answer — intent, actor, acceptance criteria — not a two-year-old git blame
  • AI agents generate better code because they have the business goal alongside the technical context
  • Requirements always show current state — when a spec changes, it's refined in place. No amendment chains, no "change request #4 layered on top of #3 layered on top of #2". The document is always the truth as it stands today.
  • Changes are safer — trace any file back to its behaviour spec and understand what breaks if you touch it
  • Nothing drifts silentlytaproot sync-check flags source files modified after their spec was last reviewed
  • Vague specs are caught at commit time — DoD/DoR gates block incomplete implementations before they merge

How requirements are stored:

taproot/
├── password-reset/        ← Intent: why this exists and for whom
│   ├── intent.md
│   └── request-reset/     ← Behaviour: what the system does
│       ├── usecase.md
│       └── email-trigger/ ← Implementation: how it's built
│           └── impl.md

Plain Markdown files, no database, git-versioned with your code. Any agent that can read files can use taproot.

Taproot tracks itself

Taproot's own requirements are managed with Taproot. taproot/OVERVIEW.md shows 18 intents, 53 behaviours, and 53 implementations — all complete — covering everything from validation rules to agent skill architecture to this README.

It's a working example of what a mature hierarchy looks like in practice.

Multi-repo projects

Taproot works across repository boundaries. If your system spans multiple repos — a platform repo plus plugin repos, a coordination repo plus service repos — you can define specs in one place and implement them independently in each repo.

A link file in the linking repo points to the spec that lives elsewhere:

# Link: Plugin Login

**Repo:** https://github.com/org/platform-repo
**Path:** taproot/specs/auth/plugin-login/usecase.md
**Type:** behaviour

Each repo's taproot coverage runs independently. The linking repo counts the behaviour as implemented via its local impl.md; the source repo marks it delegated. Both stay clean with no duplication.

Shared global truths (API contracts, domain models) work the same way — a truth link in taproot/global-truths/ is enforced at commit time, even when the truth file lives in another repo.

Use /tr-link to set up either side of the two-sided workflow interactively.

Full documentation: docs/cross-repo.md

Docs

License

MIT

Keywords

requirements

FAQs

Package last updated on 02 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts