# FR3K - Universal AI CLI Configuration System

## Table of Contents

- [FR3K - Universal AI CLI Configuration System](#fr3k---universal-ai-cli-configuration-system)
  - [✨ Features](#-features)
  - [🚀 Quick Start](#-quick-start)
    - [Global Installation](#global-installation)
- [Install FR3K globally](#install-fr3k-globally)
- [Initialize global FR3K system](#initialize-global-fr3k-system)
- [Configure all AI CLI tools](#configure-all-ai-cli-tools)
- [Check status](#check-status)
    - [Project-Specific Setup](#project-specific-setup)
- [In your project directory](#in-your-project-directory)
- [Configure specific tools](#configure-specific-tools)
- [Check configuration status](#check-configuration-status)
  - [🛠️ Supported AI CLI Tools](#-supported-ai-cli-tools)
  - [🧠 FR3k Methodology Integration](#-fr3k-methodology-integration)
    - [Planning Workflow](#planning-workflow)
    - [Execution Workflow](#execution-workflow)
  - [🤖 Specialized Agents](#-specialized-agents)
  - [🔌 MCP Server Configuration](#-mcp-server-configuration)
    - [Critical Servers (Always Installed)](#critical-servers-always-installed)
    - [Enhancement Servers (Optional)](#enhancement-servers-optional)
    - [Utility Servers (Optional)](#utility-servers-optional)
  - [📊 Quality Gates](#-quality-gates)
  - [🎯 Fabric Patterns Integration](#-fabric-patterns-integration)
- [Analysis patterns](#analysis-patterns)
- [Creation patterns](#creation-patterns)
- [Quality patterns](#quality-patterns)
  - [🔄 Dynamic Context System](#-dynamic-context-system)
  - [📝 Commands](#-commands)
    - [Core Commands](#core-commands)
- [Initialize FR3K system](#initialize-fr3k-system)
- [Configure AI CLI tools](#configure-ai-cli-tools)
- [Check system status](#check-system-status)
- [Update FR3K system](#update-fr3k-system)
    - [FR3k Workflow Commands](#fr3k-workflow-commands)
- [Planning workflows](#planning-workflows)
- [Execution workflows](#execution-workflows)
- [Agent switching](#agent-switching)
  - [🏗️ Project Structure](#-project-structure)
  - [⚙️ Configuration](#-configuration)
  - [🤝 Contributing](#-contributing)
  - [📄 License](#-license)
  - [🔗 Related Projects](#-related-projects)
  - [🆘 Support](#-support)



[![NPM Version](https://img.shields.io/npm/v/fr3k.svg)](https://npmjs.org/package/fr3k)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

🚀 **FR3K** is a universal AI CLI configuration system that auto-configures Claude Code, Gemini CLI, OpenCode, Copilot CLI, Groq CLI, and Qwen CLI with advanced development methodologies.

## ✨ Features

- 🔧 **Universal Configuration**: One command configures all AI CLI tools
- 🧠 **FR3k Methodology Integration**: Business-Managed Agile Development workflows
- 🎯 **Fabric Patterns Support**: 200+ Daniel Miessler's AI patterns for enhanced analysis
- 🤖 **Specialized Agent System**: 8 specialized agents for different development roles
- 📊 **Quality Gates & Workflows**: Systematic quality assurance throughout development
- 💾 **Critical Memory Management**: Persistent context and decision tracking
- 🔄 **Dynamic Context Loading**: Real-time context based on current task/agent

## 🚀 Quick Start

### Global Installation

```bash
# Install FR3K globally
npm install -g fr3k

# Initialize global FR3K system
fr3k init --global

# Configure all AI CLI tools
fr3k configure --all

# Check status
fr3k status
```

### Project-Specific Setup

```bash
# In your project directory
fr3k init

# Configure specific tools
fr3k configure --tools claude-code,gemini-cli

# Check configuration status
fr3k status
```

## 🛠️ Supported AI CLI Tools

| Tool | Status | Features |
|------|--------|----------|
| **Claude Code** | ✅ Full Support | MCP servers, system prompts, project structure |
| **Gemini CLI** | ✅ Full Support | Memory imports, FR3k commands, dynamic context |
| **OpenCode** | ✅ Full Support | Agent modes, FR3k integration |
| **GitHub Copilot CLI** | ✅ Full Support | Custom instructions, GitHub integration |
| **Groq CLI** | ✅ Full Support | High-performance workflows, system prompts |
| **Qwen CLI** | ✅ Full Support | Advanced reasoning, large context optimization |

## 🧠 FR3k Methodology Integration

FR3K integrates with FR3k (Business-Managed Agile Development) methodology for systematic, quality-driven development:

### Planning Workflow
1. **Analyst** → Market research, project briefs
2. **Product Manager** → PRD with epics and stories
3. **Blueprint** → System and infrastructure design
4. **Product Owner** → Validation and alignment

### Execution Workflow
1. **Scrum Master** → Sprint planning and story management
2. **QA Engineer** → Risk assessment and quality gates
3. **Developer** → Implementation with quality checks
4. **DevOps** → Infrastructure and platform management

## 🤖 Specialized Agents

FR3K provides 8 specialized agents, each enhanced with Fabric patterns:

- **fr3k-oracle**: Market research and requirements discovery
- **fr3k-product**: PRD creation and feature definition
- **fr3k-blueprint**: System architecture and technical design
- **fr3k-devops**: Infrastructure and platform engineering
- **fr3k-scrum**: Sprint management and agile facilitation
- **fr3k-qa**: Quality gates and test architecture
- **fr3k-forge**: Production code development
- **fr3k-owner**: Product validation and deliverable review

## 🔌 MCP Server Configuration

FR3K automatically configures critical MCP servers:

### Critical Servers (Always Installed)
- **hey-fr3k**: Task and memory management
- **fr3k-think**: Complex reasoning and planning
- **fr3k-remember**: Critical context preservation

### Enhancement Servers (Optional)
- **fabric-mcp**: 200+ Fabric patterns for analysis
- **dynamic-context**: Real-time context loading

### Utility Servers (Optional)
- **grep**: Code search and web research
- **snap-happy**: Screenshot and visual analysis

## 📊 Quality Gates

FR3k quality gates are integrated throughout development:

- **Pre-Development**: Risk assessment, test design
- **During Development**: Requirement tracing, NFR validation
- **Post-Development**: Comprehensive review, quality decisions
- **Infrastructure**: Platform validation, security compliance

## 🎯 Fabric Patterns Integration

Access 200+ AI patterns for enhanced capabilities:

```bash
# Analysis patterns
/fabric-enhance analyze_code
/fabric-enhance extract_insights

# Creation patterns
/fabric-enhance create_documentation
/fabric-enhance write_pull_request

# Quality patterns
/fabric-enhance assess_prompt_security
/fabric-enhance find_logical_fallacies
```

## 🏗️ Fabric-Inspired Features

FR3K incorporates key insights from the Fabric framework by Daniel Miessler, enhancing functionality with modular design and extended capabilities:

### 🌐 Web Interface (Streamlit UI)

Access FR3K through a modern web interface for GUI-based interaction:

```bash
# Install dependencies
pip install -r requirements.txt

# Launch web interface
streamlit run fr3k-web-ui.py
```

**Features:**
- 📊 **Dashboard**: System overview with MD ecosystem analysis and improvement metrics
- ⚙️ **Commands**: Execute fr3k commands through an intuitive interface
- 🤖 **Agents**: Manage and interact with specialized agents
- 📝 **Templates**: Browse and use development templates
- 🔄 **Improvement Loop**: Monitor and analyze system improvement cycles
- ⚙️ **Settings**: Configure AI models, environment variables, and preferences

### 🛠️ Helper Utilities

Enhanced productivity with specialized helper tools:

#### `fr3k-to-pdf` - Document Conversion
Convert LaTeX and Markdown files to PDF format:

```bash
# Convert LaTeX to PDF
fr3k-to-pdf document.tex

# Convert Markdown to PDF
fr3k-to-pdf document.md output.pdf

# Convert with custom output path
fr3k-to-pdf report.tex /path/to/output.pdf
```

**Features:**
- LaTeX compilation with `pdflatex`
- Markdown to LaTeX conversion
- Automatic cleanup of temporary files
- Support for complex document structures

#### `fr3k-code-helper` - Codebase Analysis
Generate comprehensive JSON representations for AI analysis:

```bash
# Analyze current directory
fr3k-code-helper .

# Analyze with custom output
fr3k-code-helper src analysis.json

# Analyze with size limits
fr3k-code-helper /path/to/project --max-files 500 --max-size 524288
```

**Analysis Includes:**
- 📁 **Directory Structure**: Complete project hierarchy
- 📊 **File Metadata**: Size, language, complexity metrics
- 🔗 **Import/Export Relationships**: Dependency mapping
- 🏗️ **Code Structure**: Functions, classes, and key components
- 📈 **Statistics**: Language distribution, file types, complexity scores

### 🎨 Modular Pattern System

Inspired by Fabric's approach to organizing AI prompts:

- **Categorized Patterns**: Commands, agents, templates organized by purpose
- **Reusable Components**: Modular design for easy extension
- **Community-Driven**: Encourage pattern sharing and collaboration
- **Version Control**: Track pattern evolution and improvements

### 🔧 Enhanced CLI Experience

Shell completion and improved command-line interaction:

```bash
# Install shell completions (inspired by Fabric)
curl -fsSL https://raw.githubusercontent.com/danielmiessler/fabric/main/completions/setup-completions.sh | bash
```

### 📈 Continuous Improvement Loop

28-cycle iterative improvement system analyzing:
- **Code Quality**: TypeScript compilation, linting, complexity
- **Documentation**: MD file validation, structure analysis
- **Prompt Effectiveness**: Template quality and pattern optimization
- **System Metrics**: Performance tracking and bottleneck identification

## 🔄 Dynamic Context System

FR3K uses dynamic markdown context loading to prevent context pollution:

- **Agent Context**: Loads capabilities for current agent
- **Task Context**: Domain-specific guidance and patterns
- **FR3k Workflow**: Current workflow state and next steps
- **Critical Memory**: Essential decisions and context

## 📝 Commands

### Core Commands

```bash
# Initialize FR3K system
fr3k init [--global] [--force]

# Configure AI CLI tools
fr3k configure [--all] [--tools <tool1,tool2>]

# Check system status
fr3k status

# Update FR3K system
fr3k update [--force]
```

### FR3k Workflow Commands

Available in configured AI CLI tools:

```bash
# Planning workflows
/analyze-market          # Market research and analysis
/create-brief            # Project brief creation
/create-prd              # Product Requirements Document
/design-architecture     # System architecture design

# Execution workflows
/create-story            # User story creation
/implement-story         # Story implementation
/assess-risk             # Risk assessment
/review-quality          # Quality assessment

# Agent switching
/switch-agent <agent>    # Switch to specialized agent
```

## 🏗️ Project Structure

FR3K creates structured project configurations:

```
your-project/
├── FR3K.md                 # Main system prompt
├── .fr3k/
│   ├── fr3k.json          # Project configuration
│   ├── commands/          # Slash commands
│   ├── agents/            # Agent configurations
│   └── hooks/             # Quality hooks
└── docs/
    ├── prd/               # Product requirements
    ├── architecture/      # System architecture
    ├── stories/           # User stories
    └── qa/                # Quality assessments
```

## ⚙️ Configuration

FR3K automatically configures each AI CLI tool with:

- **System Prompts**: FR3k methodology and specialized agent capabilities
- **MCP Servers**: Critical memory, thinking, and enhancement servers
- **Project Structure**: Organized documentation and workflow files
- **Quality Hooks**: Automated quality checks and validations

## 🤝 Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.

## 📄 License

MIT License - see LICENSE file for details.

## 🔗 Related Projects

- [FR3k Method](https://github.com/fr3k-method) - Business-Managed Agile Development
- [Fabric](https://github.com/danielmiessler/fabric) - AI pattern framework by Daniel Miessler
- [Claude Code](https://claude.ai/code) - AI coding assistant by Anthropic

## 🆘 Support

- 📚 [Documentation](https://github.com/fr3k/fr3k#readme)
- 🐛 [Issue Tracker](https://github.com/fr3k/fr3k/issues)
- 💬 [Discussions](https://github.com/fr3k/fr3k/discussions)

---

**🎉 Transform your AI development workflow with FR3K!**

Get systematic, quality-driven development with FR3k methodology, Fabric patterns, and specialized agents across all your AI CLI tools.
## Usage

```bash
npm start
```
