opción

Registra los cambios en el código mediante registros JSON estructurados, una máquina de estados obligatoria y un formato de traspaso de sesión para garantizar la continuidad de la IA.

...Expandir todo
33
Tiempo actualizado 27 de agosto de 2026

TC Tracker

Rastrea cada cambio de código mediante registros JSON estructurados, una máquina de estados forzada y un formato de traspaso de sesión que permite a una nueva sesión de IA reanudar el trabajo limpiamente cuando expira una anterior.

Overview

Un Cambio Técnico (TC) es un registro estructurado que captura qué cambió, por qué cambió, quién lo cambió, cuándo cambió, cómo se probó y dónde se encuentra el trabajo para la siguiente sesión. Los registros se almacenan como JSON en docs/TC/ dentro del proyecto objetivo, validados contra un esquema estricto y una máquina de estados.

Utiliza esta habilidad cuando el usuario:

  • Pida "rastrear este cambio" o desee un historial de auditoría para modificaciones de código
  • Quiera traspasar trabajo en curso a una sesión futura de IA
  • Necesite notas de versión estructuradas que vayan más allá de los mensajes de confirmación (commit)
  • Integre un proyecto existente y desee documentación retroactiva de cambios
  • Solicite /tc init, /tc create, /tc update, /tc status, /tc resume o /tc close

NO utilices esta habilidad cuando:

  • El usuario solo desee un registro de cambios (changelog) a partir del historial de git (utiliza engineering/changelog-generator)
  • El usuario solo desee rastrear elementos de deuda técnica (utiliza engineering/tech-debt-tracker)
  • El cambio sea trivial (error tipográfico, formato) y no afecte al comportamiento

Storage Layout

Cada proyecto almacena los TC en {project_root}/docs/TC/:

docs/TC/
├── tc_config.json          # Configuración del proyecto
├── tc_registry.json        # Índice principal + estadísticas
├── records/
│   └── TC-001-04-05-26-user-auth/
│       └── tc_record.json  # Fuente de verdad
└── evidence/
    └── TC-001/             # Fragmentos de registro, salida de comandos, capturas de pantalla

TC ID Convention

  • TC padre: TC-NNN-MM-DD-YY-slug (p. ej., TC-001-04-05-26-user-authentication)
  • Sub-TC: TC-NNN.A o TC-NNN.A.1 (letra = revisión, dígito = sub-revisión)
  • NNN es secuencial, MM-DD-YY es la fecha de creación, el slug está en formato kebab-case.

State Machine

planned -> in_progress -> implemented -> tested -> deployed
   |            |              |           |          |
   +-> blocked -+              +- in_progress  planned

Consulta references/lifecycle.md para la tabla completa de transiciones y flujos de recuperación.

Workflow Commands

La habilidad incluye cinco scripts de Python que realizan operaciones deterministas, utilizando únicamente la biblioteca estándar (stdlib), sobre los registros TC. Cada uno admite --help y --json.

1. Inicializar el rastreo en un proyecto

python3 scripts/tc_init.py --project "My Project" --root .

Crea docs/TC/, docs/TC/records/, docs/TC/evidence/, tc_config.json y tc_registry.json. Es idempotente: volver a ejecutarlo informa "ya inicializado" con las estadísticas actuales.

2. Crear un nuevo registro TC

python3 scripts/tc_create.py \
  --root . \
  --name "user-authentication" \
  --title "Add JWT-based user authentication" \
  --scope feature \
  --priority high \
  --summary "Adds JWT login + middleware" \
  --motivation "Required for protected endpoints"

Genera el siguiente ID TC secuencial, crea el directorio del registro, escribe un tc_record.json completamente poblado (estado planned, revisión de creación R1) y actualiza el registro.

3. Actualizar un registro TC

# Transición de estado (validada contra la máquina de estados)
python3 scripts/tc_update.py --root . --tc-id TC-001-04-05-26-user-auth \
  --set-status in_progress --reason "Starting implementation"

# Añadir un archivo
python3 scripts/tc_update.py --root . --tc-id TC-001-04-05-26-user-auth \
  --add-file src/auth.py:created

# Añadir datos de traspaso
python3 scripts/tc_update.py --root . --tc-id TC-001-04-05-26-user-auth \
  --handoff-progress "JWT middleware wired up" \
  --handoff-next "Write integration tests" \
  --handoff-next "Update README"

Cada cambio añade una entrada de revisión secuencial R<n></n>, actualiza updated y vuelve a validar contra el esquema antes de escribir de forma atómica (.tmp y luego renombrar).

4. Ver el estado

# TC individual
python3 scripts/tc_status.py --root . --tc-id TC-001-04-05-26-user-auth

# Todos los TC (resumen del registro)
python3 scripts/tc_status.py --root . --all --json

5. Validar un registro o el registro maestro

python3 scripts/tc_validator.py --record docs/TC/records/TC-001-.../tc_record.json
python3 scripts/tc_validator.py --registry docs/TC/tc_registry.json

El validador aplica el esquema, verifica la legalidad de la máquina de estados, comprueba los IDs secuenciales R<n></n> y T<n></n>, y asegura la consistencia de la aprobación (approved=true requiere approved_by y approved_date).

Consulta references/tc-schema.md para el esquema completo.

Slash-Command Dispatcher

El repositorio incluye un comando /tc en commands/tc.md que enruta a estos scripts según el subcomando:

CommandAction
`/tc init`Ejecutar `tc_init.py` para el proyecto actual
`/tc create `Solicitar campos, ejecutar `tc_create.py`
`/tc update `Aplicar cambios descritos por el usuario mediante `tc_update.py`
`/tc status [tc-id]`Ejecutar `tc_status.py`
`/tc resume `Mostrar traspaso, archivar sesión anterior, iniciar una nueva
`/tc close `Transicionar a `deployed`, establecer aprobación
`/tc export`Volver a generar todos los artefactos derivados
`/tc dashboard`Volver a generar el resumen del registro

El comando slash es la interfaz de usuario; los scripts de Python son el motor.

Session Handoff Format

El bloque de traspaso se encuentra en session_context.handoff dentro de cada TC y es el campo más importante para la continuidad de la IA. Contiene:

  • progress_summary — qué se ha realizado
  • next_steps — lista ordenada de acciones restantes
  • blockers — cualquier cosa que impida el progreso
  • key_context — decisiones críticas, detalles importantes y patrones que el siguiente bot debe conocer
  • files_in_progress — archivos en edición y su estado (editing, needs_review, partially_done, ready)
  • decisions_made — decisiones arquitectónicas con justificación y marca de tiempo

Consulta references/handoff-format.md para la estructura completa y las reglas de cumplimentación.

Validation Rules (Always Enforced)

  1. Máquina de estados — solo se permiten transiciones válidas.
  2. IDs secuencialesrevision_history utiliza R1, R2, R3...; test_cases utiliza T1, T2, T3....
  3. Historial de solo adición — las entradas de revisión nunca se modifican ni eliminan.
  4. Consistencia de aprobaciónapproved=true requiere approved_by y approved_date.
  5. Formato ID TC — debe coincidir con TC-NNN-MM-DD-YY-slug.
  6. Formato ID Sub-TC — debe coincidir con TC-NNN.A o TC-NNN.A.N.
  7. Escrituras atómicas — el JSON se escribe en .tmp y luego se renombra.
  8. Estadísticas del registro — se recalculan en cada escritura del registro.

Non-Blocking Bookkeeping Pattern

El rastreo TC NO debe interrumpir el flujo de trabajo principal.

  • Nunca te detengas para actualizar registros TC en línea. Sigue programando.
  • En hitos naturales, genera un subagente en segundo plano para actualizar el registro.
  • Presenta preguntas solo cuando sea estrictamente necesario ("Este trabajo no coincide con ningún TC activo: ¿crear uno?"), y pregunta una vez por sesión, no por archivo.
  • Al final de la sesión, escribe un bloque de traspaso final antes de cerrar.

Retroactive Bulk Creation

Para integrar un proyecto existente con un historial no documentado, crea un retro_changelog.json (una entrada por cambio lógico) y aliméntalo a tc_create.py en un bucle, o amplía el script para el modo por lotes. Agrupa confirmaciones (commits) por función, no por archivo.

Anti-Patterns

Anti-patternWhy it's badDo this instead
Editar `revision_history` para "corregir" un error tipográficoEl historial es de solo adición: manipularlo destruye el historial de auditoríaAñadir una nueva revisión que corrija el campo
Saltarse la máquina de estados ("establecer estado a deployed directamente")Elude la validación y oculta fases omitidasRecorrer `in_progress -> implemented -> tested -> deployed`
Crear un TC por archivo modificadoFragmenta el trabajo relacionado e infla el registroUn TC por unidad lógica (función, corrección, refactorización)
Actualizar TC en línea entre cada edición de códigoRalentiza al agente principal, desperdicia contextoGenerar un subagente en segundo plano en los hitos
Marcar `approved=true` sin `approved_by`El validador lo rechazará; historial de auditoría engañosoEstablecer siempre `approved_by` y `approved_date` conjuntamente
Sobrescribir `tc_record.json` directamente con un editor de textoRiesgo de corrupción durante la escritura y omisión de validaciónUtilizar `tc_update.py` (escritura atómica + comprobación de esquema)
Incluir secretos en `notes` o evidenciaLos registros se confirman en el repositorioReferenciar una variable de entorno o un almacén de secretos externo
Reutilizar IDs TC tras la eliminaciónRompe la garantía secuencial y confunde el historialIncrementar hacia adelante únicamente: nunca reciclar
Dejar que `next_steps` se vuelvan obsoletosContraviene el propósito del traspasoActualizar en cada hito, incluso si es "no ha cambiado nada"

Cross-References

  • engineering/changelog-generator — Genera notas de versión estilo Keep-a-Changelog a partir de Confirmaciones Convencionales. Úsalo junto con el rastreador TC: TC para el historial de auditoría detallado por cambio, changelog para las notas de versión visibles para el usuario.
  • engineering/tech-debt-tracker — Para rastrear elementos de deuda a largo plazo en lugar de cambios discretos de código.
  • engineering/focused-fix — Cuando una corrección de error necesita una reparación sistemática de toda la función, ejecuta /focused-fix primero y captura el resultado como un TC.
  • project-management/decision-log — Las decisiones arquitectónicas tomadas dentro del bloque decisions_made de un TC también pueden promoverse a un registro de decisiones a nivel de proyecto.
  • engineering-team/code-reviewer — La revisión previa a la fusión (pre-merge) encaja naturalmente en la transición tested -> deployed; captura al revisor en approval.approved_by.

References in This Skill

  • references/tc-schema.md — Esquema JSON completo para registros TC y el registro maestro.
  • references/lifecycle.md — Máquina de estados, transiciones válidas y flujos de recuperación.
  • references/handoff-format.md — Estructura de traspaso de sesión y mejores prácticas.
Ver en GitHub
---
name: tc-tracker
description: Track code changes with structured JSON records, an enforced state machine, and a session handoff format for AI continuity.
---

# TC Tracker

Track every code change with structured JSON records, an enforced state machine, and a session handoff format that lets a new AI session resume work cleanly when a previous one expires.

## Overview

A Technical Change (TC) is a structured record that captures **what** changed, **why** it changed, **who** changed it, **when** it changed, **how it was tested**, and **where work stands** for the next session. Records live as JSON in `docs/TC/` inside the target project, validated against a strict schema and a state machine.

**Use this skill when the user:**
- Asks to "track this change" or wants an audit trail for code modifications
- Wants to hand off in-progress work to a future AI session
- Needs structured release notes that go beyond commit messages
- Onboards an existing project and wants retroactive change documentation
- Asks for `/tc init`, `/tc create`, `/tc update`, `/tc status`, `/tc resume`, or `/tc close`

**Do NOT use this skill when:**
- The user only wants a changelog from git history (use `engineering/changelog-generator`)
- The user only wants to track tech debt items (use `engineering/tech-debt-tracker`)
- The change is trivial (typo, formatting) and won't affect behavior

## Storage Layout

Each project stores TCs at `{project_root}/docs/TC/`:

```
docs/TC/
├── tc_config.json          # Project settings
├── tc_registry.json        # Master index + statistics
├── records/
│   └── TC-001-04-05-26-user-auth/
│       └── tc_record.json  # Source of truth
└── evidence/
    └── TC-001/             # Log snippets, command output, screenshots
```

## TC ID Convention

- **Parent TC:** `TC-NNN-MM-DD-YY-functionality-slug` (e.g., `TC-001-04-05-26-user-authentication`)
- **Sub-TC:** `TC-NNN.A` or `TC-NNN.A.1` (letter = revision, digit = sub-revision)
- `NNN` is sequential, `MM-DD-YY` is the creation date, slug is kebab-case.

## State Machine

```
planned -> in_progress -> implemented -> tested -> deployed
   |            |              |           |          |
   +-> blocked -+              +- in_progress <-------+
        |                          (rework / hotfix)
        +-> planned
```

> See [references/lifecycle.md](references/lifecycle.md) for the full transition table and recovery flows.

## Workflow Commands

The skill ships five Python scripts that perform deterministic, stdlib-only operations on TC records. Each one supports `--help` and `--json`.

### 1. Initialize tracking in a project

```bash
python3 scripts/tc_init.py --project "My Project" --root .
```

Creates `docs/TC/`, `docs/TC/records/`, `docs/TC/evidence/`, `tc_config.json`, and `tc_registry.json`. Idempotent — re-running reports "already initialized" with current stats.

### 2. Create a new TC record

```bash
python3 scripts/tc_create.py \
  --root . \
  --name "user-authentication" \
  --title "Add JWT-based user authentication" \
  --scope feature \
  --priority high \
  --summary "Adds JWT login + middleware" \
  --motivation "Required for protected endpoints"
```

Generates the next sequential TC ID, creates the record directory, writes a fully populated `tc_record.json` (status `planned`, R1 creation revision), and updates the registry.

### 3. Update a TC record

```bash
# Status transition (validated against the state machine)
python3 scripts/tc_update.py --root . --tc-id TC-001-04-05-26-user-auth \
  --set-status in_progress --reason "Starting implementation"

# Add a file
python3 scripts/tc_update.py --root . --tc-id TC-001-04-05-26-user-auth \
  --add-file src/auth.py:created

# Append handoff data
python3 scripts/tc_update.py --root . --tc-id TC-001-04-05-26-user-auth \
  --handoff-progress "JWT middleware wired up" \
  --handoff-next "Write integration tests" \
  --handoff-next "Update README"
```

Every change appends a sequential `R<n>` revision entry, refreshes `updated`, and re-validates against the schema before writing atomically (`.tmp` then rename).

### 4. View status

```bash
# Single TC
python3 scripts/tc_status.py --root . --tc-id TC-001-04-05-26-user-auth

# All TCs (registry summary)
python3 scripts/tc_status.py --root . --all --json
```

### 5. Validate a record or registry

```bash
python3 scripts/tc_validator.py --record docs/TC/records/TC-001-.../tc_record.json
python3 scripts/tc_validator.py --registry docs/TC/tc_registry.json
```

Validator enforces the schema, checks state-machine legality, verifies sequential `R<n>` and `T<n>` IDs, and asserts approval consistency (`approved=true` requires `approved_by` and `approved_date`).

> See [references/tc-schema.md](references/tc-schema.md) for the full schema.

## Slash-Command Dispatcher

The repo ships a `/tc` slash command at `commands/tc.md` that dispatches to these scripts based on subcommand:

| Command | Action |
|---------|--------|
| `/tc init` | Run `tc_init.py` for the current project |
| `/tc create <name>` | Prompt for fields, run `tc_create.py` |
| `/tc update <tc-id>` | Apply user-described changes via `tc_update.py` |
| `/tc status [tc-id]` | Run `tc_status.py` |
| `/tc resume <tc-id>` | Display handoff, archive prior session, start a new one |
| `/tc close <tc-id>` | Transition to `deployed`, set approval |
| `/tc export` | Re-render all derived artifacts |
| `/tc dashboard` | Re-render the registry summary |

The slash command is the user interface; the Python scripts are the engine.

## Session Handoff Format

The handoff block lives at `session_context.handoff` inside each TC and is the single most important field for AI continuity. It contains:

- `progress_summary` — what has been done
- `next_steps` — ordered list of remaining actions
- `blockers` — anything preventing progress
- `key_context` — critical decisions, gotchas, patterns the next bot must know
- `files_in_progress` — files being edited and their state (`editing`, `needs_review`, `partially_done`, `ready`)
- `decisions_made` — architectural decisions with rationale and timestamp

> See [references/handoff-format.md](references/handoff-format.md) for the full structure and fill-out rules.

## Validation Rules (Always Enforced)

1. **State machine** — only valid transitions are allowed.
2. **Sequential IDs** — `revision_history` uses `R1, R2, R3...`; `test_cases` uses `T1, T2, T3...`.
3. **Append-only history** — revision entries are never modified or deleted.
4. **Approval consistency** — `approved=true` requires `approved_by` and `approved_date`.
5. **TC ID format** — must match `TC-NNN-MM-DD-YY-slug`.
6. **Sub-TC ID format** — must match `TC-NNN.A` or `TC-NNN.A.N`.
7. **Atomic writes** — JSON is written to `.tmp` then renamed.
8. **Registry stats** — recomputed on every registry write.

## Non-Blocking Bookkeeping Pattern

TC tracking must NOT interrupt the main workflow.

- **Never stop to update TC records inline.** Keep coding.
- At natural milestones, spawn a background subagent to update the record.
- Surface questions only when genuinely needed ("This work doesn't match any active TC — create one?"), and ask once per session, not per file.
- At session end, write a final handoff block before closing.

## Retroactive Bulk Creation

For onboarding an existing project with undocumented history, build a `retro_changelog.json` (one entry per logical change) and feed it to `tc_create.py` in a loop, or extend the script for batch mode. Group commits by feature, not by file.

## Anti-Patterns

| Anti-pattern | Why it's bad | Do this instead |
|--------------|--------------|-----------------|
| Editing `revision_history` to "fix" a typo | History is append-only — tampering destroys the audit trail | Add a new revision that corrects the field |
| Skipping the state machine ("just set status to deployed") | Bypasses validation and hides skipped phases | Walk through `in_progress -> implemented -> tested -> deployed` |
| Creating one TC per file changed | Fragments related work and explodes the registry | One TC per logical unit (feature, fix, refactor) |
| Updating TC inline between every code edit | Slows the main agent, wastes context | Spawn a background subagent at milestones |
| Marking `approved=true` without `approved_by` | Validator will reject; misleading audit trail | Always set `approved_by` and `approved_date` together |
| Overwriting `tc_record.json` directly with a text editor | Risks corruption mid-write and skips validation | Use `tc_update.py` (atomic write + schema check) |
| Putting secrets in `notes` or evidence | Records are committed to the repo | Reference an env var or external secret store |
| Reusing TC IDs after deletion | Breaks the sequential guarantee and confuses history | Increment forward only — never recycle |
| Letting `next_steps` go stale | Defeats the purpose of handoff | Update on every milestone, even if it's "nothing changed" |

## Cross-References

- `engineering/changelog-generator` — Generates Keep-a-Changelog release notes from Conventional Commits. Pair it with TC tracker: TC for the granular per-change audit trail, changelog for user-facing release notes.
- `engineering/tech-debt-tracker` — For tracking long-lived debt items rather than discrete code changes.
- `engineering/focused-fix` — When a bug fix needs systematic feature-wide repair, run `/focused-fix` first then capture the result as a TC.
- `project-management/decision-log` — Architectural decisions made inside a TC's `decisions_made` block can also be promoted to a project-wide decision log.
- `engineering-team/code-reviewer` — Pre-merge review fits naturally into the `tested -> deployed` transition; capture the reviewer in `approval.approved_by`.

## References in This Skill

- [references/tc-schema.md](references/tc-schema.md) — Full JSON schema for TC records and the registry.
- [references/lifecycle.md](references/lifecycle.md) — State machine, valid transitions, and recovery flows.
- [references/handoff-format.md](references/handoff-format.md) — Session handoff structure and best practices.

Todos los archivos

0 archivos

Instalar tc-tracker

Descarga y extrae los archivos de habilidades en tu directorio .claude/skills/.

Descargar ZIP

Clona el repositorio y copia los archivos de la habilidad a tu proyecto.

git clone https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skills/tc-tracker # Copy SKILL.md to your .claude/skills/ directory

Copiar Copiar
Configuración rápida: Copia la carpeta de la habilidad a .claude/skills/ Claude detectará y utilizará automáticamente la habilidad

Habilidades relacionadas

golang-dependency-injection
Tiempo actualizado 29 de junio de 2026
nuxthub
Tiempo actualizado 23 de agosto de 2026
code-quality
Tiempo actualizado 22 de agosto de 2026
altimate-data-engineering-skills
Tiempo actualizado 23 de agosto de 2026
OR