oneie 3.6.24 → 3.6.26

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.
Files changed (73) hide show
  1. package/.claude/agents/agent-backend.md +2 -2
  2. package/.claude/agents/agent-builder.md +226 -198
  3. package/.claude/agents/agent-designer.md +167 -11
  4. package/.claude/agents/agent-director.md +180 -112
  5. package/.claude/agents/agent-frontend.md +154 -8
  6. package/.claude/agents/agent-onboard.md +1 -1
  7. package/.claude/agents/agent-ontology.md +2 -2
  8. package/.claude/agents/agent-ops.md +58 -38
  9. package/.claude/agents/agent-quality.md +377 -0
  10. package/.claude/agents/agent-sales.md +3 -3
  11. package/.claude/commands/cascade.md +21 -21
  12. package/.claude/commands/create.md +19 -19
  13. package/.claude/commands/deploy.md +82 -104
  14. package/.claude/commands/mcp-on.md +191 -0
  15. package/.claude/commands/one.md +267 -92
  16. package/.claude/commands/plan.md +17 -17
  17. package/.claude/commands/release.md +65 -14
  18. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +473 -0
  19. package/.claude/hooks/README-knowledge-hooks.md +451 -0
  20. package/.claude/hooks/README-root-cleanup.md +200 -0
  21. package/.claude/hooks/README.md +284 -0
  22. package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
  23. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  24. package/.claude/hooks/check-filenames.py +177 -0
  25. package/.claude/hooks/clean-post.py +468 -0
  26. package/.claude/hooks/clean-pre.py +393 -0
  27. package/.claude/hooks/clean-root-markdown.sh +73 -0
  28. package/.claude/hooks/commit-push.sh +95 -0
  29. package/.claude/hooks/done.py +236 -0
  30. package/.claude/hooks/format-hook.sh +163 -0
  31. package/.claude/hooks/hook-logger.sh +173 -0
  32. package/.claude/hooks/knowledge-post.py +355 -0
  33. package/.claude/hooks/knowledge-pre.py +245 -0
  34. package/.claude/hooks/mcp-on.sh +134 -0
  35. package/.claude/hooks/notification-hook.sh +279 -0
  36. package/.claude/hooks/push.sh +101 -0
  37. package/.claude/hooks/release-cli.sh +16 -8
  38. package/.claude/hooks/root-cleanup.py +217 -0
  39. package/.claude/hooks/security-hook.sh +397 -0
  40. package/.claude/hooks/tag-all-docs.py +464 -0
  41. package/.claude/hooks/test-validate-ontology.sh +170 -0
  42. package/.claude/hooks/todo.py +368 -0
  43. package/.claude/hooks/track-changes.sh +101 -0
  44. package/.claude/hooks/validate-ontology-structure-summary.md +243 -0
  45. package/.claude/hooks/validate-ontology-structure.py +518 -0
  46. package/.claude/skills/INDEX.md +1 -1
  47. package/.claude/skills/ontology/README.md +1 -1
  48. package/CLAUDE.md +105 -0
  49. package/dist/commands/agent.d.ts +18 -0
  50. package/dist/commands/agent.d.ts.map +1 -0
  51. package/dist/commands/agent.js +271 -0
  52. package/dist/commands/agent.js.map +1 -0
  53. package/dist/commands/init.js +1 -1
  54. package/dist/commands/init.js.map +1 -1
  55. package/dist/index.js +20 -0
  56. package/dist/index.js.map +1 -1
  57. package/dist/lib/agent-detection.d.ts +19 -0
  58. package/dist/lib/agent-detection.d.ts.map +1 -0
  59. package/dist/lib/agent-detection.js +87 -0
  60. package/dist/lib/agent-detection.js.map +1 -0
  61. package/dist/lib/detect.d.ts +45 -0
  62. package/dist/lib/detect.d.ts.map +1 -0
  63. package/dist/lib/detect.js +221 -0
  64. package/dist/lib/detect.js.map +1 -0
  65. package/llms.txt +257 -0
  66. package/one/knowledge/games-english.md +691 -0
  67. package/one/knowledge/games.md +1082 -0
  68. package/one/things/plans/npx-agent-safety.md +785 -0
  69. package/one/things/plans/npx-agent.md +1089 -0
  70. package/one/things/plans/remove-backend-development-from-agents.md +1331 -0
  71. package/package.json +3 -2
  72. package/.claude/commands/mcp-toggle.md +0 -93
  73. package/.claude/commands/npx.md +0 -84
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Context Detection Utilities
3
+ *
4
+ * Intelligently detects user and organization context from multiple sources:
5
+ * - Claude Code environment variables
6
+ * - Git configuration
7
+ * - package.json
8
+ * - README.md
9
+ * - Directory structure
10
+ */
11
+ import { exec } from "child_process";
12
+ import { promisify } from "util";
13
+ import * as fs from "fs-extra";
14
+ import * as path from "path";
15
+ const execAsync = promisify(exec);
16
+ /**
17
+ * Helper to get CLI argument value
18
+ */
19
+ function getCliArg(argName) {
20
+ const index = process.argv.indexOf(argName);
21
+ if (index !== -1 && index + 1 < process.argv.length) {
22
+ return process.argv[index + 1];
23
+ }
24
+ return undefined;
25
+ }
26
+ /**
27
+ * Detects user identity from multiple sources
28
+ * Priority: CLI flags → Claude context → git config → env vars → defaults
29
+ */
30
+ export async function detectUserIdentity() {
31
+ // 1. Check CLI flags (highest priority - explicit override)
32
+ const nameFlag = getCliArg("--name");
33
+ const emailFlag = getCliArg("--email");
34
+ if (nameFlag || emailFlag) {
35
+ return {
36
+ name: nameFlag || "Developer",
37
+ email: emailFlag || "dev@localhost",
38
+ };
39
+ }
40
+ // 2. Check Claude context flags (from Claude Code)
41
+ const claudeUser = getCliArg("--claude-user");
42
+ const claudeEmail = getCliArg("--claude-email");
43
+ if (claudeUser) {
44
+ return {
45
+ name: claudeUser,
46
+ email: claudeEmail || "dev@localhost",
47
+ };
48
+ }
49
+ // 3. Check Claude environment variables
50
+ if (process.env.CLAUDE_USER_NAME) {
51
+ return {
52
+ name: process.env.CLAUDE_USER_NAME,
53
+ email: process.env.CLAUDE_USER_EMAIL || "dev@localhost",
54
+ };
55
+ }
56
+ // 4. Try git config
57
+ try {
58
+ const { stdout: gitName } = await execAsync("git config user.name");
59
+ const { stdout: gitEmail } = await execAsync("git config user.email");
60
+ if (gitName && gitEmail) {
61
+ return {
62
+ name: gitName.trim(),
63
+ email: gitEmail.trim(),
64
+ };
65
+ }
66
+ }
67
+ catch { }
68
+ // 5. Try standard environment variables
69
+ if (process.env.GIT_AUTHOR_NAME && process.env.GIT_AUTHOR_EMAIL) {
70
+ return {
71
+ name: process.env.GIT_AUTHOR_NAME,
72
+ email: process.env.GIT_AUTHOR_EMAIL,
73
+ };
74
+ }
75
+ // 6. Fallback to defaults
76
+ return {
77
+ name: "Developer",
78
+ email: "dev@localhost",
79
+ };
80
+ }
81
+ /**
82
+ * Detects organization name from multiple sources
83
+ * Priority: CLI flag → Claude context → git remote → package.json → README → directory → default
84
+ */
85
+ export async function detectOrganization(basePath = process.cwd()) {
86
+ // 1. Check CLI flag (explicit override)
87
+ const orgFlag = getCliArg("--org");
88
+ if (orgFlag)
89
+ return orgFlag;
90
+ // 2. Check Claude context
91
+ const claudeOrg = getCliArg("--claude-org");
92
+ if (claudeOrg)
93
+ return claudeOrg;
94
+ // 3. Check Claude environment variable
95
+ if (process.env.CLAUDE_ORG_NAME) {
96
+ return process.env.CLAUDE_ORG_NAME;
97
+ }
98
+ // 4. Try git remote URL
99
+ try {
100
+ const { stdout: remote } = await execAsync("git config --get remote.origin.url");
101
+ const match = remote.match(/github\.com[:/]([^/]+)\//);
102
+ if (match && match[1])
103
+ return match[1];
104
+ }
105
+ catch { }
106
+ // 5. Try package.json
107
+ const packagePath = path.join(basePath, "package.json");
108
+ if (await fs.pathExists(packagePath)) {
109
+ try {
110
+ const pkg = await fs.readJson(packagePath);
111
+ if (pkg.author?.name)
112
+ return pkg.author.name;
113
+ if (pkg.organization)
114
+ return pkg.organization;
115
+ if (typeof pkg.author === "string") {
116
+ // Parse "Name <email>" format
117
+ const match = pkg.author.match(/^([^<]+)/);
118
+ if (match)
119
+ return match[1].trim();
120
+ }
121
+ }
122
+ catch { }
123
+ }
124
+ // 6. Try README.md
125
+ const readmePath = path.join(basePath, "README.md");
126
+ if (await fs.pathExists(readmePath)) {
127
+ try {
128
+ const readme = await fs.readFile(readmePath, "utf-8");
129
+ const match = readme.match(/^#\s+(.+)$/m);
130
+ if (match && match[1])
131
+ return match[1];
132
+ }
133
+ catch { }
134
+ }
135
+ // 7. Use parent directory name
136
+ const parentDir = path.basename(path.resolve(basePath, ".."));
137
+ if (parentDir && parentDir !== "/" && parentDir !== ".") {
138
+ return parentDir;
139
+ }
140
+ // 8. Default
141
+ return "Default Organization";
142
+ }
143
+ /**
144
+ * Detects website URL from multiple sources
145
+ * Priority: CLI flag → package.json → README → git remote
146
+ */
147
+ export async function detectWebsite(basePath = process.cwd()) {
148
+ // 1. Check CLI flag
149
+ const websiteFlag = getCliArg("--website");
150
+ if (websiteFlag)
151
+ return websiteFlag;
152
+ // 2. Try package.json homepage
153
+ const packagePath = path.join(basePath, "package.json");
154
+ if (await fs.pathExists(packagePath)) {
155
+ try {
156
+ const pkg = await fs.readJson(packagePath);
157
+ if (pkg.homepage)
158
+ return pkg.homepage;
159
+ }
160
+ catch { }
161
+ }
162
+ // 3. Try README.md (look for URLs)
163
+ const readmePath = path.join(basePath, "README.md");
164
+ if (await fs.pathExists(readmePath)) {
165
+ try {
166
+ const readme = await fs.readFile(readmePath, "utf-8");
167
+ // Look for URLs in markdown
168
+ const urlMatch = readme.match(/https?:\/\/[^\s)]+/);
169
+ if (urlMatch)
170
+ return urlMatch[0];
171
+ }
172
+ catch { }
173
+ }
174
+ // 4. Try converting git remote to website URL
175
+ try {
176
+ const { stdout: remote } = await execAsync("git config --get remote.origin.url");
177
+ const match = remote.match(/github\.com[:/]([^/]+)\/([^/.]+)/);
178
+ if (match) {
179
+ const [, owner, repo] = match;
180
+ return `https://github.com/${owner}/${repo}`;
181
+ }
182
+ }
183
+ catch { }
184
+ return undefined;
185
+ }
186
+ /**
187
+ * Detects project name from directory or package.json
188
+ */
189
+ export async function detectProjectName(basePath = process.cwd()) {
190
+ // Try package.json name
191
+ const packagePath = path.join(basePath, "package.json");
192
+ if (await fs.pathExists(packagePath)) {
193
+ try {
194
+ const pkg = await fs.readJson(packagePath);
195
+ if (pkg.name)
196
+ return pkg.name;
197
+ }
198
+ catch { }
199
+ }
200
+ // Use current directory name
201
+ return path.basename(basePath);
202
+ }
203
+ /**
204
+ * Detects complete context for agent setup
205
+ */
206
+ export async function detectContext(basePath = process.cwd()) {
207
+ const [user, organization, website, projectName] = await Promise.all([
208
+ detectUserIdentity(),
209
+ detectOrganization(basePath),
210
+ detectWebsite(basePath),
211
+ detectProjectName(basePath),
212
+ ]);
213
+ return {
214
+ user,
215
+ organization,
216
+ website,
217
+ projectName,
218
+ projectPath: basePath,
219
+ };
220
+ }
221
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/lib/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAelC;;GAEG;AACH,SAAS,SAAS,CAAC,OAAe;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACpD,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,4DAA4D;IAC5D,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,QAAQ,IAAI,WAAW;YAC7B,KAAK,EAAE,SAAS,IAAI,eAAe;SACpC,CAAC;IACJ,CAAC;IAED,mDAAmD;IACnD,MAAM,UAAU,GAA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BAAiB,CACrC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAEhC,wBAAwB;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACxD,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAC3C,IAAI,GAAG,CAAC,IAAI;gBAAE,OAAO,GAAG,CAAC,IAAI,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;IAED,6BAA6B;IAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAEhC,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnE,kBAAkB,EAAE;QACpB,kBAAkB,CAAC,QAAQ,CAAC;QAC5B,aAAa,CAAC,QAAQ,CAAC;QACvB,iBAAiB,CAAC,QAAQ,CAAC;KAC5B,CAAC,CAAC;IAEH,OAAO;QACL,IAAI;QACJ,YAAY;QACZ,OAAO;QACP,WAAW;QACX,WAAW,EAAE,QAAQ;KACtB,CAAC;AACJ,CAAC"}
package/llms.txt ADDED
@@ -0,0 +1,257 @@
1
+ # ONE CLI - llms.txt
2
+
3
+ This file provides guidance for Large Language Models (LLMs) and AI coding assistants on how to use the ONE Platform CLI.
4
+
5
+ ## For AI Agents: Use `npx oneie agent`
6
+
7
+ **IMPORTANT:** If you are an AI agent (Claude Code, Cursor, Windsurf, GitHub Copilot, or running in CI/CD), ALWAYS use the agent command:
8
+
9
+ ```bash
10
+ npx oneie agent
11
+ ```
12
+
13
+ ### Why Agent Mode?
14
+
15
+ - **Zero interaction** - No prompts, no hanging, completes in 5-10 seconds
16
+ - **Smart detection** - Auto-discovers user/org from git, environment, files
17
+ - **Safe execution** - Never blocks on input, automatic rollback on errors
18
+ - **Universal** - Works with all AI coding tools and CI/CD environments
19
+
20
+ ### Agent Detection
21
+
22
+ The CLI automatically detects agent environments by checking:
23
+ - `CLAUDE_CODE`, `CLAUDE_USER_NAME` - Claude Code
24
+ - `GITHUB_COPILOT` - GitHub Copilot
25
+ - `CURSOR_AI` - Cursor
26
+ - `CODEIUM_API_KEY` - Windsurf
27
+ - `CI`, `GITHUB_ACTIONS`, etc. - CI/CD
28
+ - `!process.stdin.isTTY` - Non-interactive terminal
29
+
30
+ If you run `npx oneie` (interactive command) in an agent environment, you'll see:
31
+ ```
32
+ ⚠️ Agent environment detected!
33
+ Did you mean to run: npx oneie agent
34
+ ```
35
+
36
+ ### Context Detection
37
+
38
+ The agent command auto-detects context with this priority:
39
+
40
+ **User Identity:**
41
+ 1. CLI flags: `--name`, `--email`
42
+ 2. Claude context: `--claude-user`, `--claude-email`, `CLAUDE_USER_NAME`
43
+ 3. Git config: `git config user.name/user.email`
44
+ 4. Environment: `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`
45
+ 5. Defaults: `"Developer"`, `"dev@localhost"`
46
+
47
+ **Organization:**
48
+ 1. CLI flags: `--org`
49
+ 2. Claude context: `--claude-org`, `CLAUDE_ORG_NAME`
50
+ 3. Git remote: Parse from github.com/org-name/repo
51
+ 4. package.json: `author.name`, `organization`
52
+ 5. README.md: First H1 heading
53
+ 6. Directory: Parent directory name
54
+ 7. Default: `"Default Organization"`
55
+
56
+ **Website:**
57
+ 1. CLI flag: `--website`
58
+ 2. package.json: `homepage`
59
+ 3. README.md: First URL found
60
+ 4. Git remote: Convert to GitHub URL
61
+
62
+ ### Usage Examples
63
+
64
+ **Basic (fully automatic):**
65
+ ```bash
66
+ npx oneie agent
67
+ ```
68
+
69
+ **With explicit Claude context:**
70
+ ```bash
71
+ npx oneie agent \
72
+ --claude-user="Jane Smith" \
73
+ --claude-email="jane@startup.com" \
74
+ --claude-org="My Startup"
75
+ ```
76
+
77
+ **Quiet mode (for scripts/CI):**
78
+ ```bash
79
+ npx oneie agent --quiet
80
+ ```
81
+
82
+ **Dry run (preview without changes):**
83
+ ```bash
84
+ npx oneie agent --dry-run
85
+ ```
86
+
87
+ **Verbose (show detected agent type):**
88
+ ```bash
89
+ npx oneie agent --verbose
90
+ ```
91
+
92
+ ### What Gets Created
93
+
94
+ When you run `npx oneie agent`, it:
95
+ 1. Copies `/one` directory (ontology, docs, specs)
96
+ 2. Copies `/.claude` directory (agents, commands, hooks)
97
+ 3. Copies root documentation (CLAUDE.md, README.md, LICENSE.md, SECURITY.md, .mcp.json)
98
+ 4. Creates installation folder: `/<org-slug>/`
99
+ 5. Creates `.onboarding.json` handoff file
100
+ 6. Updates `.env.local` with organization settings
101
+ 7. Updates `.gitignore` to exclude installation folder
102
+ 8. Optionally clones web template (if not present)
103
+
104
+ ### Next Steps After Setup
105
+
106
+ After `npx oneie agent` completes:
107
+ 1. Run Claude Code: `claude`
108
+ 2. Use `/one` command to see control center
109
+ 3. Start building with `/chat [idea]` or `/plan convert`
110
+
111
+ ### Available Flags
112
+
113
+ **Context Flags:**
114
+ - `--name="Your Name"` - User name (explicit override)
115
+ - `--email="your@email.com"` - User email (explicit override)
116
+ - `--claude-user="Name"` - User name from Claude context
117
+ - `--claude-email="email"` - User email from Claude
118
+ - `--claude-org="Org"` - Organization from Claude
119
+ - `--org="Organization"` - Organization name (explicit override)
120
+ - `--website="https://example.com"` - Organization website
121
+
122
+ **Behavior Flags:**
123
+ - `--quiet` - Minimal output (for automation)
124
+ - `--verbose` - Detailed output with agent type
125
+ - `--dry-run` - Show plan without executing
126
+ - `--skip-web` - Don't clone web template
127
+
128
+ **Environment Variables:**
129
+ - `CLAUDE_USER_NAME` - User name from Claude Code
130
+ - `CLAUDE_USER_EMAIL` - User email from Claude Code
131
+ - `CLAUDE_ORG_NAME` - Organization from Claude Code
132
+
133
+ ## For Humans: Use `npx oneie`
134
+
135
+ If you are a human user wanting guided interactive setup:
136
+
137
+ ```bash
138
+ npx oneie
139
+ ```
140
+
141
+ Or force interactive mode in agent environment:
142
+
143
+ ```bash
144
+ npx oneie --interactive
145
+ ```
146
+
147
+ ## Common Workflows
148
+
149
+ ### Workflow 1: AI Agent Sets Up Project
150
+
151
+ ```bash
152
+ # User: "Set up ONE Platform for my project"
153
+ # Agent runs:
154
+ npx oneie agent
155
+
156
+ # Output:
157
+ # ✅ Your ONE Platform is ready!
158
+ # Next steps: /one
159
+
160
+ # Agent continues:
161
+ # "Your platform is ready! What would you like to build?"
162
+ ```
163
+
164
+ ### Workflow 2: CI/CD Integration
165
+
166
+ ```yaml
167
+ # .github/workflows/setup.yml
168
+ name: Setup ONE Platform
169
+ on: [push]
170
+ jobs:
171
+ setup:
172
+ runs-on: ubuntu-latest
173
+ steps:
174
+ - uses: actions/checkout@v2
175
+ - run: npx oneie agent --quiet
176
+ - run: cd web && bun install && bun test
177
+ ```
178
+
179
+ ### Workflow 3: Claude Code with Custom Context
180
+
181
+ ```bash
182
+ # Claude Code automatically passes context:
183
+ npx oneie agent \
184
+ --claude-user="$USER_NAME" \
185
+ --claude-email="$USER_EMAIL" \
186
+ --claude-org="$ORG_NAME"
187
+ ```
188
+
189
+ ## Error Handling
190
+
191
+ ### If Agent Detection Fails
192
+
193
+ The CLI will default to safe values:
194
+ - User: "Developer" <dev@localhost>
195
+ - Organization: "Default Organization"
196
+
197
+ You can always override with explicit flags.
198
+
199
+ ### If Git Not Configured
200
+
201
+ The CLI will show a warning but continue with defaults. To fix:
202
+ ```bash
203
+ git config --global user.name "Your Name"
204
+ git config --global user.email "your@email.com"
205
+ ```
206
+
207
+ ### If Installation Fails
208
+
209
+ The CLI automatically rolls back all changes. You can retry:
210
+ ```bash
211
+ npx oneie agent --dry-run # Check what would happen
212
+ npx oneie agent --verbose # See detailed output
213
+ ```
214
+
215
+ ## Performance
216
+
217
+ - **Setup time:** 5-10 seconds (vs 2-3 minutes interactive)
218
+ - **Context detection:** < 1 second
219
+ - **File operations:** ~5 seconds
220
+ - **Total improvement:** 98% faster than interactive
221
+
222
+ ## Agent Experience Philosophy
223
+
224
+ **"Agent Experience First"** - The CLI is designed so agents never get stuck on prompts they can't answer. If an agent accidentally runs the interactive command, it will:
225
+ 1. Detect the agent environment
226
+ 2. Show helpful error message
227
+ 3. Suggest correct command: `npx oneie agent`
228
+ 4. Exit cleanly without hanging
229
+
230
+ This ensures agents can automate project setup as part of natural conversation flow without manual intervention.
231
+
232
+ ## Documentation
233
+
234
+ For complete documentation, see:
235
+ - README.md - Platform overview
236
+ - CLAUDE.md - Instructions for Claude Code
237
+ - /one/knowledge/ontology.md - 6-dimension ontology
238
+ - /web/src/content/docs/getting-started/quick-start.md - Quick start guide
239
+ - /web/src/content/docs/getting-started/claude-commands.md - Claude commands reference
240
+
241
+ ## Support
242
+
243
+ If you encounter issues:
244
+ 1. Run with `--verbose` to see detailed output
245
+ 2. Run with `--dry-run` to preview changes
246
+ 3. Check git configuration: `git config user.name && git config user.email`
247
+ 4. Check GitHub issues: https://github.com/one-ie/cli/issues
248
+
249
+ ## Version
250
+
251
+ Current version: 1.0.0
252
+ Agent command added: v1.1.0
253
+
254
+ ## License
255
+
256
+ Copyright © 2025 ONE
257
+ ONE Free License - see LICENSE.md