trackfw for AI Agents
trackfw was designed from the ground up to be native to AI agent workflows. This page explains how to take full advantage of this integration.
Why AI agents need structured governance
AI agents like Claude Code, OpenAI Codex, Gemini CLI, Google Antigravity, Cursor, GitHub Copilot, Windsurf, Amazon Q, OpenCode, and Kiro (10 targets) operate in independent sessions. Without a persistent record of decisions and context, each session starts from scratch — the agent doesn't know:
- Which architectural decisions have already been made (and why)
- Which requirements are in progress
- Which roadmaps are active and in what state
- What was discussed and decided in previous sessions
The result is redundancy, inconsistency, and regressions: the agent redoes investigations already completed, makes decisions that contradict existing ADRs, or implements features that conflict with active roadmaps.
trackfw solves this with structured Markdown artifacts that any agent can read, interpret, and update at runtime.
YAML Frontmatter — parseable by LLMs
All artifacts generated by trackfw include a YAML frontmatter block at the start of the file:
ADR (Architecture Decision Record)
---
status: Accepted
date: 2026-06-13
author: "Kleber Saran"
---
# ADR: Use PostgreSQL as main database
...REQ (Requirement)
---
status: Open
date: 2026-06-13
author: ""
adr: ADR-2026-06-13-use-postgresql.md
roadmap: ""
---
# REQ: OAuth Login
...ROADMAP
---
status: wip
date: 2026-06-13
req: docs/req/REQ-2026-06-13-oauth-login.md
squad: backend
---
# Roadmap: Implement OAuth
...trackfw validate runs the CLI's internal governance rules — it checks frontmatter fields, section presence, and acceptance criteria across ADRs, REQs, and Roadmaps.
trackfw context --format=json
The context command aggregates the entire governance state of the project into a single structured output, optimized for inclusion in LLM prompts.
trackfw context --format=jsonExample output
{
"project": "my-project",
"governance_score": 80,
"adrs": [
{
"file": "ADR-2026-06-13-use-postgresql.md",
"status": "Accepted"
},
{
"file": "ADR-2026-06-13-oauth-provider.md",
"status": "Draft"
}
],
"reqs": [
{
"file": "REQ-2026-06-13-oauth-login.md",
"status": "Open"
}
],
"roadmaps": {
"backlog": [],
"wip": ["ROADMAP-2026-06-13-implement-oauth.md"],
"blocked": [],
"done": ["ROADMAP-2026-06-01-setup-ci.md"]
},
"violations": [],
"warnings": [
"ADR-2026-06-13-oauth-provider.md is Draft — REQ may be blocked"
]
}How to use in prompts
# Include context directly in the agent prompt
CONTEXT=$(trackfw context --format=json)
# Example with curl to Anthropic API
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d "{
\"model\": \"claude-opus-4-5\",
\"max_tokens\": 4096,
\"messages\": [{
\"role\": \"user\",
\"content\": \"Project governance context: $CONTEXT\n\nCreate a new roadmap to implement OAuth login.\"
}]
}"Markdown format (human-readable)
trackfw context --format=md# Governance Context — my-project
**Governance Score:** 80/100
## ADRs (2)
- ADR-2026-06-13-use-postgresql.md — Accepted
- ADR-2026-06-13-oauth-provider.md — Draft
## REQs (1)
- REQ-2026-06-13-oauth-login.md — Open
## Roadmaps
- **WIP:** ROADMAP-2026-06-13-implement-oauth.md
- **Done:** ROADMAP-2026-06-01-setup-ci.md
## Warnings
- ADR-2026-06-13-oauth-provider.md is Draft — REQ may be blockedtrackfw roadmap new --from-req — assisted generation
The --from-req flag allows an agent to create a roadmap directly linked to an existing REQ, without needing the interactive wizard:
trackfw roadmap new --from-req docs/req/REQ-2026-06-13-oauth-login.mdThe REQ content is injected into the roadmap template, giving the agent the necessary context to fill in the implementation microbatches.
Typical flow with an agent:
# 1. Agent reads project context
trackfw context --format=json > /tmp/context.json
# 2. Agent creates a roadmap linked to the open REQ
trackfw roadmap new --from-req docs/req/REQ-2026-06-13-oauth-login.md
# 3. Agent edits the generated roadmap with implementation microbatches
# (file is in docs/roadmaps/backlog/)
# 4. Agent moves to WIP when starting implementation
trackfw roadmap move oauth-login wip
# 5. Agent validates at the end
trackfw validateFrontmatter validation
trackfw validate runs the CLI's internal governance rules — it checks frontmatter fields (status, date, links), section presence, and acceptance criteria across ADRs, REQs, and Roadmaps. The docs/schema/ directory is not generated by trackfw init.
Complete prompt example for Claude Code
Use the output of trackfw context as a system prefix to ensure the agent operates within the project's governance constraints:
You are an expert implementation agent.
## Project governance context
[OUTPUT FROM: trackfw context --format=md]
## Instructions
- Before implementing any feature, verify that an open REQ covering the scope exists.
- If it doesn't exist, create one first with `trackfw req new`.
- When starting implementation, move the roadmap to WIP: `trackfw roadmap move <name> wip`.
- After completing each microbatch, update the roadmap and run `trackfw validate`.
- After completing the full implementation, move to Done: `trackfw roadmap move <name> done`.
- Never make architectural decisions without creating or referencing an ADR.
## Task
[TASK DESCRIPTION]Integration with Claude Code via slash commands
When you select Claude Code during trackfw init, 9 slash commands are generated in .claude/commands/trackfw/:
| Command | Action |
|---|---|
/trackfw:adr | New ADR — trackfw adr new "$ARGUMENTS" |
/trackfw:architect | Architecture guide — stack choice, design direction |
/trackfw:barrier | Wave release barrier — governed wave checklist |
/trackfw:implement | Implementation orchestrator — follows the ML flow |
/trackfw:move | Move roadmap — trackfw roadmap move $ARGUMENTS |
/trackfw:req | New REQ — trackfw req new "$ARGUMENTS" |
/trackfw:roadmap | Generate a roadmap in microbatches for a REQ |
/trackfw:status | Project status — trackfw status |
/trackfw:validate | Governance validation — trackfw validate |
Usage in Claude Code
/trackfw:validateMulti-CLI installation and lifecycle
Agents and skills are managed with the following commands:
trackfw agents list
trackfw agents install --targets claude,codex --items architect,backend --scope project
trackfw agents update --targets claude,codex
trackfw agents uninstall --targets claude,codex
trackfw skills list --json
trackfw skills install --targets gemini,antigravity --items governance,implement
trackfw skills update --targets gemini,antigravity
trackfw skills uninstall --targets gemini,antigravityThe targets are Claude Code, Codex, Gemini CLI, Antigravity, Cursor, GitHub Copilot, Windsurf, Amazon Q, OpenCode, and Kiro (10 targets). Shared flags are:
| Flag | Usage |
|---|---|
--targets <csv> | Target CLIs; required for mutations without a TTY |
--items <csv> | Specific agents or skills; defaults to all |
--scope project|global | Repository or user-directory installation |
--surface target=surface | Selects a surface, for example kiro=cli |
--json | Returns catalog, deployments, support, representation, and state |
--force | Allows replacing/removing only modified managed content |
In an interactive terminal, mutations without --targets show a selector, and targets with more than one current surface ask which surface to use. list also inspects legacy surfaces. To select old compatibility explicitly:
trackfw agents list --targets antigravity --surface antigravity=legacy-cliEach deployment is not-installed, current, outdated, or modified. The .trackfw/integrations-manifest.json manifest records ownership, version, SHA-256, and shared claims per scope. update and uninstall preserve customizations without --force; uninstall never removes an unmanaged file. Known historical templates can be adopted without overwrite and migrated with update. Unknown content is never adopted by update, even with --force.
Gemini CLI
# Export context for use with Gemini
trackfw context --format=json | gemini --model gemini-2.0-flash "Analyze the governance state and suggest next steps."OpenAI Codex
Select OpenAI Codex in trackfw init, or use the lifecycle:
trackfw agents install --targets codex --scope project
trackfw skills install --targets codex --scope projectThe adapter generates twelve specialist TOML agents under .codex/agents/ (architect, backend, frontend, qa, infra, security, code-quality, dba, ux, data, iac, tooling) and governance skills under .agents/skills/, with safe ownership and conservative updates.
Cursor
Add to the project's .cursorrules:
Always run `trackfw context --format=json` at the start of each session.
Never implement features without a corresponding open REQ.
Update the active roadmap after each completed microbatch.
Run `trackfw validate` before each commit.CI/CD Integration
trackfw validate returns exit code 1 on violations — use it as a CI gate:
GitHub Actions
- name: trackfw validate
run: trackfw validateGitLab CI
trackfw:validate:
stage: test
script:
- trackfw validateThe scripts/trackfw-validate.sh script generated by trackfw init already contains the correct configuration for your project stack.