conflux-ai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Conflux
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # Conflux
2
+
3
+ **One config to rule them all.** Define your AI coding tool configuration once in `.ai/config.yaml` — sync to Claude Code, Codex, Cursor, Windsurf, GitHub Copilot, Gemini CLI, Aider, and more.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/conflux-ai)](https://www.npmjs.com/package/conflux-ai)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ ## The Problem
9
+
10
+ Using multiple AI coding tools means maintaining duplicate configuration files:
11
+
12
+ ```
13
+ CLAUDE.md ← Claude Code (project instructions)
14
+ AGENTS.md ← Codex CLI (same content, different name)
15
+ .claude/settings.json ← hooks + MCP + permissions (JSON)
16
+ .codex/hooks.json ← same hooks (different format)
17
+ .codex/config.toml ← same MCP servers (TOML)
18
+ .cursorrules ← same instructions again
19
+ ```
20
+
21
+ Add a new MCP server or project rule, and you update 5+ files across 3+ formats.
22
+
23
+ ## The Solution
24
+
25
+ Conflux lets you define everything **once** in `.ai/config.yaml` and syncs it to each tool in its native format:
26
+
27
+ ```bash
28
+ conflux init # Scan existing configs → .ai/config.yaml
29
+ conflux sync # Generate all tool-specific configs
30
+ conflux status # Check for drift (manual edits)
31
+ ```
32
+
33
+ ```yaml
34
+ # .ai/config.yaml
35
+ version: 1
36
+
37
+ instructions:
38
+ primary: AGENTS.md
39
+
40
+ mcp:
41
+ servers:
42
+ filesystem:
43
+ command: npx
44
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
45
+
46
+ hooks:
47
+ SessionStart:
48
+ - command: "python hooks/session-start.py"
49
+ timeout: 15
50
+
51
+ providers:
52
+ enabled: [claude-code, codex, cursor]
53
+ ```
54
+
55
+ One `conflux sync` generates:
56
+ - `CLAUDE.md` → wrapper pointing to `@AGENTS.md`
57
+ - `AGENTS.md` → primary instruction file
58
+ - `.claude/settings.json` → merged hooks + MCP + permissions
59
+ - `.codex/hooks.json` → Codex hook format
60
+ - `.cursor/mcp.json` → Cursor MCP format
61
+
62
+ ## Quick Start
63
+
64
+ ```bash
65
+ # Install
66
+ npm install -g conflux-ai
67
+
68
+ # Initialize in your project
69
+ cd your-project
70
+ conflux init
71
+
72
+ # Review and customize .ai/config.yaml
73
+ # Then sync
74
+ conflux sync
75
+
76
+ # See what's supported
77
+ conflux providers
78
+ ```
79
+
80
+ ## Features
81
+
82
+ ### 5 Configuration Dimensions
83
+
84
+ | Dimension | Description | Example Outputs |
85
+ |-----------|------------|----------------|
86
+ | 📋 **Instructions** | Project rules & context | `CLAUDE.md`, `AGENTS.md`, `.cursorrules` |
87
+ | 🪝 **Hooks** | Lifecycle events | `.claude/settings.json`, `.codex/hooks.json` |
88
+ | 🔌 **MCP Servers** | Model Context Protocol | `.claude/settings.json`, `.cursor/mcp.json` |
89
+ | 🔒 **Permissions** | Allow/deny rules | `.claude/settings.json`, `.codex/config.toml` |
90
+ | ⚡ **Skills** | Reusable commands | `.claude/skills/`, `.cursor/skills/` |
91
+
92
+ ### Supported Tools (MVP)
93
+
94
+ | Tool | Instructions | Hooks | MCP | Permissions | Skills |
95
+ |------|:-----------:|:-----:|:---:|:-----------:|:------:|
96
+ | **Claude Code** | ✅ | ✅ | ✅ | ✅ | ✅ |
97
+ | **Codex CLI** | ✅ | ✅ | ✅ | ✅ | ✅ |
98
+ | **Cursor** | ✅ | ❌ | ✅ | ⚠️ | ✅ |
99
+
100
+ More tools coming in v1.0: Windsurf, GitHub Copilot, Gemini CLI, Aider.
101
+
102
+ ### Key Capabilities
103
+
104
+ - **Auto-detect** — finds which AI tools you use
105
+ - **Drift detection** — warns when generated files are manually edited
106
+ - **Capability-aware** — gracefully skips unsupported features per tool
107
+ - **Provider overrides** — tool-specific customizations when needed
108
+ - **JSON Schema** — IDE autocompletion for `.ai/config.yaml`
109
+ - **Dry-run mode** — preview changes before writing
110
+
111
+ ## CLI Commands
112
+
113
+ ```
114
+ conflux init # Create .ai/config.yaml from existing configs
115
+ conflux sync # Sync config to all detected tools
116
+ conflux status # Check for drift (coming in v1.0)
117
+ conflux providers # List supported tools
118
+ conflux doctor # Validate and diagnose (coming in v1.0)
119
+ conflux clean # Remove generated configs (coming in v1.0)
120
+ ```
121
+
122
+ ### Global Options
123
+
124
+ ```
125
+ -d, --dry-run Preview changes without writing
126
+ -v, --verbose Verbose output
127
+ -p, --project <path> Project root (default: cwd)
128
+ --json Machine-readable output
129
+ -y, --yes Skip confirmation prompts
130
+ ```
131
+
132
+ ## Programmatic Usage
133
+
134
+ ```typescript
135
+ import { loadConfig, registry } from "conflux-ai";
136
+
137
+ const config = loadConfig("/path/to/project");
138
+ const provider = registry.get("claude-code");
139
+ const result = await provider?.sync("/path/to/project", config);
140
+
141
+ console.log(result?.filesWritten.map(f => f.path));
142
+ // ["CLAUDE.md", ".claude/settings.json"]
143
+ ```
144
+
145
+ ## Roadmap
146
+
147
+ ### v0.1 (MVP) — Current
148
+ - [x] 3 providers: Claude Code, Codex CLI, Cursor
149
+ - [x] 2 dimensions: Instructions + MCP
150
+ - [x] `init` + `sync` + `providers` commands
151
+ - [x] JSON Schema for IDE autocompletion
152
+
153
+ ### v1.0 — Next
154
+ - [ ] All 5 dimensions (hooks + permissions + skills)
155
+ - [ ] 7 providers (+ Windsurf, Copilot, Gemini CLI, Aider)
156
+ - [ ] `status` (drift detection) + `doctor` + `clean`
157
+ - [ ] Monorepo support
158
+
159
+ ### v2.0 — Future
160
+ - [ ] 15+ providers
161
+ - [ ] File watching (auto-sync on save)
162
+ - [ ] Community plugin SDK (`@conflux/provider-sdk`)
163
+ - [ ] VS Code extension
164
+ - [ ] GitHub Actions CI integration
165
+
166
+ ## Contributing
167
+
168
+ See [CONTRIBUTING.md](CONTRIBUTING.md) (coming soon).
169
+
170
+ ### Adding a Provider
171
+
172
+ Create a new provider by extending `AIProvider`:
173
+
174
+ ```typescript
175
+ import { AIProvider, ProviderCapability } from "conflux-ai";
176
+
177
+ export class MyProvider extends AIProvider {
178
+ id = "my-tool";
179
+ name = "My Tool";
180
+ version = "1.0.0";
181
+ capabilities = [ProviderCapability.INSTRUCTIONS, ProviderCapability.MCP];
182
+
183
+ detect(projectPath: string): boolean {
184
+ // Check for marker files
185
+ }
186
+
187
+ generateInstructions(config): GeneratedFile[] {
188
+ // Generate tool-specific instruction files
189
+ }
190
+
191
+ // ...implement other methods
192
+ }
193
+ ```
194
+
195
+ ## Related Projects
196
+
197
+ - [std-agent](https://github.com/StringKe/std-ai) — Go-based config sync for 22 tools
198
+ - [AgentBrew](https://www.npmjs.com/package/agentbrew) — TypeScript skill manager for 45+ agents
199
+ - [AGENTS.md Standard](https://github.com/agentmd/agent.md) — Emerging standard for agent instructions
200
+
201
+ ## License
202
+
203
+ MIT
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node