# CFLX Skills

Conflux workflow management skills for AI coding assistants.

## Overview

Conflux uses a **router + per-operation skill** architecture. New orchestrator prompts load dedicated operation-specific skills directly, while `cflx-workflow` remains as a backward-compatible router for legacy prompts.

```
[Human] → cflx-proposal → Proposal Creation (interactive)
                ↓
        [Committed change on base branch]
                ↓
           cflx-run → `cflx run` orchestration
                ↓
        ┌─────────────────────────────────────┐
        │  Orchestrator loads dedicated skills │
        ├─────────────────────────────────────┤
        │  cflx-analyze  → Dependency analysis│
        │  cflx-apply    → Implementation     │
        │  cflx-rejecting→ Rejection review   │
        │  cflx-cleanup-review → Cleanup      │
        │  cflx-accept   → Acceptance review  │
        │  cflx-archive  → Finalization       │
        │  cflx-resolve  → Conflict resolution│
        └─────────────────────────────────────┘
```

## Skills

### cflx-proposal

**Purpose**: Create structured change proposals through interactive conversation with users.

**Characteristics**:
- Human-interactive mode
- Asks clarifying questions
- Guides users through proposal structure

### cflx-run

**Purpose**: Prepare a clean base branch and run `cflx run` for committed OpenSpec changes.

**Characteristics**:
- Human-invoked operational mode
- Verifies clean working tree and base branch
- Runs Conflux orchestration and reviews the merge result

### Operation-Specific Skills (Dedicated)

These skills are loaded directly by the orchestrator for each operation:

| Skill | Operation | Purpose |
|-------|-----------|---------|
| `cflx-analyze` | analyze | Dependency analysis and change selection |
| `cflx-apply` | apply | Implement approved changes |
| `cflx-rejecting` | rejecting | Review rejection proposals |
| `cflx-cleanup-review` | cleanup-review | Post-apply worktree cleanup |
| `cflx-accept` | accept | Acceptance review (operation identity) |
| `cflx-archive` | archive | Finalize deployed changes |
| `cflx-resolve` | resolve | Merge conflict resolution |

All operation-specific skills are autonomous (cannot ask questions) and are called by the orchestration system, not for direct human use.

### cflx-workflow (Compatibility Router)

**Purpose**: Backward-compatible router for legacy prompts that use `load skills: cflx-workflow`.

**Characteristics**:
- Self-contained: provides legacy-equivalent guidance for apply / rejecting / cleanup-review / accept / archive without requiring additional skill loads
- Does not require cross-skill auxiliary file access
- New orchestrator prompts should use dedicated operation-specific skills instead

## Installation

```bash
cflx install-skills
```

This installs all bundled skills:
- `cflx-proposal` - For interactive proposal creation
- `cflx-run` - For executing `cflx run` from a clean base branch
- `cflx-workflow` - Compatibility router for legacy prompts
- `cflx-analyze` - Dependency analysis
- `cflx-apply` - Change implementation
- `cflx-rejecting` - Rejection review
- `cflx-cleanup-review` - Post-apply cleanup
- `cflx-accept` - Acceptance review identity
- `cflx-archive` - Change archival
- `cflx-resolve` - Conflict resolution

## Requirements

- **cflx binary**: The `cflx` binary provides native `cflx openspec` subcommands for all OpenSpec operations
- **Git**: For version control operations

## Built-in Tools

OpenSpec operations are provided natively by the `cflx` binary:

```bash
cflx openspec list                # List changes
cflx openspec list --specs        # List specs
cflx openspec show <id>           # Show change details
cflx openspec validate <id> --strict  # Validate change
cflx openspec archive <id> --yes  # Archive change
```

## Key Principles

### Mock-First External Dependencies

- Mock/stub/fixture external dependencies for verification
- Do not block on missing API keys or credentials
- Only truly non-mockable dependencies go to Future Work

### Task Management

- Update `tasks.md` immediately after each task completion
- Active sections must have checkboxes (`- [ ]` or `- [x]`)
- Future Work sections must NOT have checkboxes

### Implementation Blocker Gate

- Apply can escalate `IMPLEMENTATION_BLOCKER` when implementation is truly impossible in current loop
- Accept can return `ACCEPTANCE: BLOCKED` only with concrete blocker evidence

### Autonomous Execution (all operation-specific skills)

- No questions allowed during execution
- Make decisions based on available context
- Do not defer tasks based on difficulty

## License

MIT
