# Features Command

The `features` command manages the growth feature registry -- a persistent record of all growth features detected across analysis runs.

## Prerequisites

- A `feature-registry.json` file generated by the `analyze` command. Run `skene analyze .` first.

## Basic usage

Export the feature registry as JSON (to stdout):

```bash
uvx skene features export
```

Export as Markdown to a file:

```bash
uvx skene features export --format markdown -o features.md
```

Export as CSV:

```bash
uvx skene features export --format csv -o features.csv
```

## Flag reference

| Flag | Short | Description |
|------|-------|-------------|
| `PATH` | | Project root (default: `.`) |
| `--context PATH` | `-c` | Path to `skene-context` directory (auto-detected if omitted) |
| `--format TEXT` | `-f` | Output format: `json`, `csv`, `markdown` (default: `json`) |
| `--output PATH` | `-o` | Output file path. Prints to stdout if omitted. |

## The feature registry

The feature registry (`feature-registry.json`) is automatically maintained by the `analyze` command. It provides:

- **Persistent tracking** -- features are tracked across multiple analysis runs
- **Merge-update semantics** -- new features are added, existing features are updated, missing features are archived
- **Growth loop mapping** -- features are linked to growth loop definitions via `loop_ids`
- **Growth pillars** -- features are annotated with 0-3 pillars: `onboarding`, `engagement`, `retention`

### Registry structure

```json
{
  "version": "1.0",
  "updated_at": "2025-01-15T10:30:00",
  "features": [
    {
      "feature_id": "team_invitations",
      "feature_name": "Team Invitations",
      "status": "active",
      "first_seen_at": "2025-01-10T08:00:00",
      "last_seen_at": "2025-01-15T10:30:00",
      "loop_ids": ["invite_flow"],
      "growth_pillars": ["onboarding", "engagement"]
    }
  ],
  "growth_loops": [
    {
      "loop_id": "invite_flow",
      "name": "Invite Flow",
      "linked_feature_id": "team_invitations"
    }
  ]
}
```

### Feature statuses

| Status | Meaning |
|--------|---------|
| `active` | Feature was detected in the most recent analysis run |
| `archived` | Feature was previously detected but not found in the latest run |

## Export formats

### JSON

Full registry data including all metadata, timestamps, and loop mappings.

### CSV

Tabular format suitable for spreadsheets and data tools. Includes feature ID, name, status, pillars, and linked loop IDs.

### Markdown

Human-readable format suitable for documentation, wikis, or README files.

## Features-only analysis

To update the feature registry without running a full analysis (skipping opportunities and revenue leakage):

```bash
uvx skene analyze . --features
```

This is faster than a full analysis and useful when you only need to refresh the feature registry.

## Next steps

- [Analyze](analyze.md) -- Full codebase analysis that populates the feature registry
- [Build](build.md) -- Generate growth loops linked to features
- [CLI Reference](../reference/cli.md) -- Full reference for all commands and flags
