@claude-flow/codex 3.0.0-alpha.1
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/README.md +301 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +649 -0
- package/dist/cli.js.map +1 -0
- package/dist/generators/agents-md.d.ts +12 -0
- package/dist/generators/agents-md.d.ts.map +1 -0
- package/dist/generators/agents-md.js +641 -0
- package/dist/generators/agents-md.js.map +1 -0
- package/dist/generators/config-toml.d.ts +74 -0
- package/dist/generators/config-toml.d.ts.map +1 -0
- package/dist/generators/config-toml.js +910 -0
- package/dist/generators/config-toml.js.map +1 -0
- package/dist/generators/index.d.ts +9 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +9 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/skill-md.d.ts +20 -0
- package/dist/generators/skill-md.d.ts.map +1 -0
- package/dist/generators/skill-md.js +946 -0
- package/dist/generators/skill-md.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/initializer.d.ts +87 -0
- package/dist/initializer.d.ts.map +1 -0
- package/dist/initializer.js +666 -0
- package/dist/initializer.js.map +1 -0
- package/dist/migrations/index.d.ts +114 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +856 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/templates/index.d.ts +92 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +284 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/types.d.ts +218 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/validators/index.d.ts +42 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +929 -0
- package/dist/validators/index.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @claude-flow/codex - AGENTS.md Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates AGENTS.md files for OpenAI Codex CLI
|
|
5
|
+
* Following the Agentic AI Foundation standard
|
|
6
|
+
*/
|
|
7
|
+
import { BUILT_IN_SKILLS } from '../templates/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate an AGENTS.md file based on the provided options
|
|
10
|
+
*/
|
|
11
|
+
export async function generateAgentsMd(options) {
|
|
12
|
+
const template = options.template ?? 'default';
|
|
13
|
+
switch (template) {
|
|
14
|
+
case 'minimal':
|
|
15
|
+
return generateMinimal(options);
|
|
16
|
+
case 'full':
|
|
17
|
+
return generateFull(options);
|
|
18
|
+
case 'enterprise':
|
|
19
|
+
return generateEnterprise(options);
|
|
20
|
+
case 'default':
|
|
21
|
+
default:
|
|
22
|
+
return generateDefault(options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Generate minimal AGENTS.md template
|
|
27
|
+
*/
|
|
28
|
+
function generateMinimal(options) {
|
|
29
|
+
const { projectName, description = 'A Claude Flow powered project', buildCommand = 'npm run build', testCommand = 'npm test', } = options;
|
|
30
|
+
return `# ${projectName}
|
|
31
|
+
|
|
32
|
+
> ${description}
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
### Setup
|
|
37
|
+
\`\`\`bash
|
|
38
|
+
npm install && ${buildCommand}
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
### Test
|
|
42
|
+
\`\`\`bash
|
|
43
|
+
${testCommand}
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
## Agent Behavior
|
|
47
|
+
|
|
48
|
+
### Code Standards
|
|
49
|
+
- Keep files under 500 lines
|
|
50
|
+
- No hardcoded secrets or credentials
|
|
51
|
+
- Validate input at system boundaries
|
|
52
|
+
- Use typed interfaces for public APIs
|
|
53
|
+
|
|
54
|
+
### File Organization
|
|
55
|
+
- \`/src\` - Source code files
|
|
56
|
+
- \`/tests\` - Test files
|
|
57
|
+
- \`/docs\` - Documentation
|
|
58
|
+
- \`/config\` - Configuration files
|
|
59
|
+
|
|
60
|
+
## Skills
|
|
61
|
+
|
|
62
|
+
| Skill | Purpose |
|
|
63
|
+
|-------|---------|
|
|
64
|
+
| \`$swarm-orchestration\` | Multi-agent coordination for complex tasks |
|
|
65
|
+
| \`$memory-management\` | Pattern storage and semantic search |
|
|
66
|
+
|
|
67
|
+
## Security Rules
|
|
68
|
+
|
|
69
|
+
- NEVER commit .env files or secrets
|
|
70
|
+
- Always validate user inputs
|
|
71
|
+
- Prevent directory traversal attacks
|
|
72
|
+
- Use parameterized queries for databases
|
|
73
|
+
- Sanitize output to prevent XSS
|
|
74
|
+
|
|
75
|
+
## Links
|
|
76
|
+
|
|
77
|
+
- Documentation: https://github.com/ruvnet/claude-flow
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Generate default AGENTS.md template
|
|
82
|
+
*/
|
|
83
|
+
function generateDefault(options) {
|
|
84
|
+
const { projectName, description = 'A Claude Flow powered project', techStack = 'TypeScript, Node.js', buildCommand = 'npm run build', testCommand = 'npm test', devCommand = 'npm run dev', skills = ['swarm-orchestration', 'memory-management', 'sparc-methodology', 'security-audit'], } = options;
|
|
85
|
+
const skillsTable = skills
|
|
86
|
+
.map((skill) => {
|
|
87
|
+
const info = BUILT_IN_SKILLS[skill];
|
|
88
|
+
return info
|
|
89
|
+
? `| \`$${skill}\` | ${info.description} |`
|
|
90
|
+
: `| \`$${skill}\` | Custom skill |`;
|
|
91
|
+
})
|
|
92
|
+
.join('\n');
|
|
93
|
+
return `# ${projectName}
|
|
94
|
+
|
|
95
|
+
> Multi-agent orchestration framework for agentic coding
|
|
96
|
+
|
|
97
|
+
## Project Overview
|
|
98
|
+
|
|
99
|
+
${description}
|
|
100
|
+
|
|
101
|
+
**Tech Stack**: ${techStack}
|
|
102
|
+
**Architecture**: Domain-Driven Design with bounded contexts
|
|
103
|
+
|
|
104
|
+
## Quick Start
|
|
105
|
+
|
|
106
|
+
### Installation
|
|
107
|
+
\`\`\`bash
|
|
108
|
+
npm install
|
|
109
|
+
\`\`\`
|
|
110
|
+
|
|
111
|
+
### Build
|
|
112
|
+
\`\`\`bash
|
|
113
|
+
${buildCommand}
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
### Test
|
|
117
|
+
\`\`\`bash
|
|
118
|
+
${testCommand}
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
### Development
|
|
122
|
+
\`\`\`bash
|
|
123
|
+
${devCommand}
|
|
124
|
+
\`\`\`
|
|
125
|
+
|
|
126
|
+
## Agent Coordination
|
|
127
|
+
|
|
128
|
+
### Swarm Configuration
|
|
129
|
+
|
|
130
|
+
This project uses hierarchical swarm coordination for complex tasks:
|
|
131
|
+
|
|
132
|
+
| Setting | Value | Purpose |
|
|
133
|
+
|---------|-------|---------|
|
|
134
|
+
| Topology | \`hierarchical\` | Queen-led coordination (anti-drift) |
|
|
135
|
+
| Max Agents | 8 | Optimal team size |
|
|
136
|
+
| Strategy | \`specialized\` | Clear role boundaries |
|
|
137
|
+
| Consensus | \`raft\` | Leader-based consistency |
|
|
138
|
+
|
|
139
|
+
### When to Use Swarms
|
|
140
|
+
|
|
141
|
+
**Invoke swarm for:**
|
|
142
|
+
- Multi-file changes (3+ files)
|
|
143
|
+
- New feature implementation
|
|
144
|
+
- Cross-module refactoring
|
|
145
|
+
- API changes with tests
|
|
146
|
+
- Security-related changes
|
|
147
|
+
- Performance optimization
|
|
148
|
+
|
|
149
|
+
**Skip swarm for:**
|
|
150
|
+
- Single file edits
|
|
151
|
+
- Simple bug fixes (1-2 lines)
|
|
152
|
+
- Documentation updates
|
|
153
|
+
- Configuration changes
|
|
154
|
+
|
|
155
|
+
### Available Skills
|
|
156
|
+
|
|
157
|
+
Use \`$skill-name\` syntax to invoke:
|
|
158
|
+
|
|
159
|
+
| Skill | Use Case |
|
|
160
|
+
|-------|----------|
|
|
161
|
+
${skillsTable}
|
|
162
|
+
|
|
163
|
+
### Agent Types
|
|
164
|
+
|
|
165
|
+
| Type | Role | Use Case |
|
|
166
|
+
|------|------|----------|
|
|
167
|
+
| \`researcher\` | Requirements analysis | Understanding scope |
|
|
168
|
+
| \`architect\` | System design | Planning structure |
|
|
169
|
+
| \`coder\` | Implementation | Writing code |
|
|
170
|
+
| \`tester\` | Test creation | Quality assurance |
|
|
171
|
+
| \`reviewer\` | Code review | Security and quality |
|
|
172
|
+
|
|
173
|
+
## Code Standards
|
|
174
|
+
|
|
175
|
+
### File Organization
|
|
176
|
+
- **NEVER** save to root folder
|
|
177
|
+
- \`/src\` - Source code files
|
|
178
|
+
- \`/tests\` - Test files
|
|
179
|
+
- \`/docs\` - Documentation
|
|
180
|
+
- \`/config\` - Configuration files
|
|
181
|
+
|
|
182
|
+
### Quality Rules
|
|
183
|
+
- Files under 500 lines
|
|
184
|
+
- No hardcoded secrets
|
|
185
|
+
- Input validation at boundaries
|
|
186
|
+
- Typed interfaces for public APIs
|
|
187
|
+
- TDD London School (mock-first) preferred
|
|
188
|
+
|
|
189
|
+
### Commit Messages
|
|
190
|
+
\`\`\`
|
|
191
|
+
<type>(<scope>): <description>
|
|
192
|
+
|
|
193
|
+
[optional body]
|
|
194
|
+
|
|
195
|
+
Co-Authored-By: claude-flow <ruv@ruv.net>
|
|
196
|
+
\`\`\`
|
|
197
|
+
|
|
198
|
+
Types: \`feat\`, \`fix\`, \`docs\`, \`style\`, \`refactor\`, \`perf\`, \`test\`, \`chore\`
|
|
199
|
+
|
|
200
|
+
## Security
|
|
201
|
+
|
|
202
|
+
### Critical Rules
|
|
203
|
+
- NEVER commit secrets, credentials, or .env files
|
|
204
|
+
- NEVER hardcode API keys
|
|
205
|
+
- Always validate user input
|
|
206
|
+
- Use parameterized queries for SQL
|
|
207
|
+
- Sanitize output to prevent XSS
|
|
208
|
+
|
|
209
|
+
### Path Security
|
|
210
|
+
- Validate all file paths
|
|
211
|
+
- Prevent directory traversal (../)
|
|
212
|
+
- Use absolute paths internally
|
|
213
|
+
|
|
214
|
+
## Memory System
|
|
215
|
+
|
|
216
|
+
### Storing Patterns
|
|
217
|
+
\`\`\`bash
|
|
218
|
+
npx @claude-flow/cli memory store \\
|
|
219
|
+
--key "pattern-name" \\
|
|
220
|
+
--value "pattern description" \\
|
|
221
|
+
--namespace patterns
|
|
222
|
+
\`\`\`
|
|
223
|
+
|
|
224
|
+
### Searching Memory
|
|
225
|
+
\`\`\`bash
|
|
226
|
+
npx @claude-flow/cli memory search \\
|
|
227
|
+
--query "search terms" \\
|
|
228
|
+
--namespace patterns
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
## Links
|
|
232
|
+
|
|
233
|
+
- Documentation: https://github.com/ruvnet/claude-flow
|
|
234
|
+
- Issues: https://github.com/ruvnet/claude-flow/issues
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Generate full AGENTS.md template with all sections
|
|
239
|
+
*/
|
|
240
|
+
function generateFull(options) {
|
|
241
|
+
const base = generateDefault(options);
|
|
242
|
+
const additionalSections = `
|
|
243
|
+
## Performance Targets
|
|
244
|
+
|
|
245
|
+
| Metric | Target | Notes |
|
|
246
|
+
|--------|--------|-------|
|
|
247
|
+
| HNSW Search | 150x-12,500x faster | Vector operations |
|
|
248
|
+
| Memory Reduction | 50-75% | Int8 quantization |
|
|
249
|
+
| MCP Response | <100ms | API latency |
|
|
250
|
+
| CLI Startup | <500ms | Cold start |
|
|
251
|
+
| SONA Adaptation | <0.05ms | Neural learning |
|
|
252
|
+
|
|
253
|
+
## Testing
|
|
254
|
+
|
|
255
|
+
### Running Tests
|
|
256
|
+
\`\`\`bash
|
|
257
|
+
# Unit tests
|
|
258
|
+
npm test
|
|
259
|
+
|
|
260
|
+
# Integration tests
|
|
261
|
+
npm run test:integration
|
|
262
|
+
|
|
263
|
+
# Coverage
|
|
264
|
+
npm run test:coverage
|
|
265
|
+
|
|
266
|
+
# Security tests
|
|
267
|
+
npm run test:security
|
|
268
|
+
\`\`\`
|
|
269
|
+
|
|
270
|
+
### Test Philosophy
|
|
271
|
+
- TDD London School (mock-first)
|
|
272
|
+
- Unit tests for business logic
|
|
273
|
+
- Integration tests for boundaries
|
|
274
|
+
- E2E tests for critical paths
|
|
275
|
+
- Security tests for sensitive operations
|
|
276
|
+
|
|
277
|
+
### Coverage Requirements
|
|
278
|
+
- Minimum 80% line coverage
|
|
279
|
+
- 100% coverage for security-critical code
|
|
280
|
+
- All public APIs must have tests
|
|
281
|
+
|
|
282
|
+
## MCP Integration
|
|
283
|
+
|
|
284
|
+
Claude Flow exposes tools via Model Context Protocol:
|
|
285
|
+
|
|
286
|
+
\`\`\`bash
|
|
287
|
+
# Start MCP server
|
|
288
|
+
npx @claude-flow/cli mcp start
|
|
289
|
+
|
|
290
|
+
# List available tools
|
|
291
|
+
npx @claude-flow/cli mcp tools
|
|
292
|
+
\`\`\`
|
|
293
|
+
|
|
294
|
+
### Available Tools
|
|
295
|
+
|
|
296
|
+
| Tool | Purpose | Example |
|
|
297
|
+
|------|---------|---------|
|
|
298
|
+
| \`swarm_init\` | Initialize swarm coordination | \`swarm_init({topology: "hierarchical"})\` |
|
|
299
|
+
| \`agent_spawn\` | Spawn new agents | \`agent_spawn({type: "coder", name: "dev-1"})\` |
|
|
300
|
+
| \`memory_store\` | Store in AgentDB | \`memory_store({key: "pattern", value: "..."})\` |
|
|
301
|
+
| \`memory_search\` | Semantic search | \`memory_search({query: "auth patterns"})\` |
|
|
302
|
+
| \`task_orchestrate\` | Task coordination | \`task_orchestrate({task: "implement feature"})\` |
|
|
303
|
+
| \`neural_train\` | Train neural patterns | \`neural_train({iterations: 10})\` |
|
|
304
|
+
| \`benchmark_run\` | Performance benchmarks | \`benchmark_run({type: "all"})\` |
|
|
305
|
+
|
|
306
|
+
## Hooks System
|
|
307
|
+
|
|
308
|
+
Claude Flow uses hooks for lifecycle automation:
|
|
309
|
+
|
|
310
|
+
### Core Hooks
|
|
311
|
+
|
|
312
|
+
| Hook | Trigger | Purpose |
|
|
313
|
+
|------|---------|---------|
|
|
314
|
+
| \`pre-task\` | Before task starts | Get context, load patterns |
|
|
315
|
+
| \`post-task\` | After task completes | Record completion, train |
|
|
316
|
+
| \`pre-edit\` | Before file changes | Validate, backup |
|
|
317
|
+
| \`post-edit\` | After file changes | Train patterns, verify |
|
|
318
|
+
| \`pre-command\` | Before shell commands | Security check |
|
|
319
|
+
| \`post-command\` | After shell commands | Log results |
|
|
320
|
+
|
|
321
|
+
### Session Hooks
|
|
322
|
+
|
|
323
|
+
| Hook | Purpose |
|
|
324
|
+
|------|---------|
|
|
325
|
+
| \`session-start\` | Initialize context, load memory |
|
|
326
|
+
| \`session-end\` | Export metrics, consolidate memory |
|
|
327
|
+
| \`session-restore\` | Resume from checkpoint |
|
|
328
|
+
| \`notify\` | Send notifications |
|
|
329
|
+
|
|
330
|
+
### Intelligence Hooks
|
|
331
|
+
|
|
332
|
+
| Hook | Purpose |
|
|
333
|
+
|------|---------|
|
|
334
|
+
| \`route\` | Route task to appropriate agents |
|
|
335
|
+
| \`explain\` | Generate explanations |
|
|
336
|
+
| \`pretrain\` | Pre-train neural patterns |
|
|
337
|
+
| \`build-agents\` | Build specialized agents |
|
|
338
|
+
| \`transfer\` | Transfer learning between domains |
|
|
339
|
+
|
|
340
|
+
### Example Usage
|
|
341
|
+
\`\`\`bash
|
|
342
|
+
# Before starting a task
|
|
343
|
+
npx @claude-flow/cli hooks pre-task \\
|
|
344
|
+
--description "implementing authentication"
|
|
345
|
+
|
|
346
|
+
# After completing a task
|
|
347
|
+
npx @claude-flow/cli hooks post-task \\
|
|
348
|
+
--task-id "task-123" \\
|
|
349
|
+
--success true
|
|
350
|
+
|
|
351
|
+
# Route a task to agents
|
|
352
|
+
npx @claude-flow/cli hooks route \\
|
|
353
|
+
--task "implement OAuth2 login flow"
|
|
354
|
+
\`\`\`
|
|
355
|
+
|
|
356
|
+
## Background Workers
|
|
357
|
+
|
|
358
|
+
12 background workers provide continuous optimization:
|
|
359
|
+
|
|
360
|
+
| Worker | Priority | Purpose |
|
|
361
|
+
|--------|----------|---------|
|
|
362
|
+
| \`ultralearn\` | normal | Deep knowledge acquisition |
|
|
363
|
+
| \`optimize\` | high | Performance optimization |
|
|
364
|
+
| \`consolidate\` | low | Memory consolidation |
|
|
365
|
+
| \`predict\` | normal | Predictive preloading |
|
|
366
|
+
| \`audit\` | critical | Security analysis |
|
|
367
|
+
| \`map\` | normal | Codebase mapping |
|
|
368
|
+
| \`preload\` | low | Resource preloading |
|
|
369
|
+
| \`deepdive\` | normal | Deep code analysis |
|
|
370
|
+
| \`document\` | normal | Auto-documentation |
|
|
371
|
+
| \`refactor\` | normal | Refactoring suggestions |
|
|
372
|
+
| \`benchmark\` | normal | Performance benchmarking |
|
|
373
|
+
| \`testgaps\` | normal | Test coverage analysis |
|
|
374
|
+
|
|
375
|
+
### Managing Workers
|
|
376
|
+
\`\`\`bash
|
|
377
|
+
# List workers
|
|
378
|
+
npx @claude-flow/cli hooks worker list
|
|
379
|
+
|
|
380
|
+
# Trigger specific worker
|
|
381
|
+
npx @claude-flow/cli hooks worker dispatch --trigger audit
|
|
382
|
+
|
|
383
|
+
# Check worker status
|
|
384
|
+
npx @claude-flow/cli hooks worker status
|
|
385
|
+
\`\`\`
|
|
386
|
+
|
|
387
|
+
## Intelligence System
|
|
388
|
+
|
|
389
|
+
The RuVector Intelligence System provides neural learning:
|
|
390
|
+
|
|
391
|
+
### Components
|
|
392
|
+
- **SONA**: Self-Optimizing Neural Architecture (<0.05ms adaptation)
|
|
393
|
+
- **MoE**: Mixture of Experts for specialized routing
|
|
394
|
+
- **HNSW**: Hierarchical Navigable Small World for fast search
|
|
395
|
+
- **EWC++**: Elastic Weight Consolidation (prevents forgetting)
|
|
396
|
+
- **Flash Attention**: Optimized attention mechanism
|
|
397
|
+
|
|
398
|
+
### 4-Step Pipeline
|
|
399
|
+
1. **RETRIEVE** - Fetch relevant patterns via HNSW
|
|
400
|
+
2. **JUDGE** - Evaluate with verdicts (success/failure)
|
|
401
|
+
3. **DISTILL** - Extract key learnings via LoRA
|
|
402
|
+
4. **CONSOLIDATE** - Prevent catastrophic forgetting via EWC++
|
|
403
|
+
|
|
404
|
+
## Debugging
|
|
405
|
+
|
|
406
|
+
### Log Levels
|
|
407
|
+
\`\`\`bash
|
|
408
|
+
# Set log level
|
|
409
|
+
export CLAUDE_FLOW_LOG_LEVEL=debug
|
|
410
|
+
|
|
411
|
+
# Enable verbose mode
|
|
412
|
+
npx @claude-flow/cli --verbose <command>
|
|
413
|
+
\`\`\`
|
|
414
|
+
|
|
415
|
+
### Health Checks
|
|
416
|
+
\`\`\`bash
|
|
417
|
+
# Run diagnostics
|
|
418
|
+
npx @claude-flow/cli doctor --fix
|
|
419
|
+
|
|
420
|
+
# Check system status
|
|
421
|
+
npx @claude-flow/cli status
|
|
422
|
+
\`\`\`
|
|
423
|
+
`;
|
|
424
|
+
return base + additionalSections;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Generate enterprise AGENTS.md template with governance
|
|
428
|
+
*/
|
|
429
|
+
function generateEnterprise(options) {
|
|
430
|
+
const full = generateFull(options);
|
|
431
|
+
const enterpriseSections = `
|
|
432
|
+
## Governance
|
|
433
|
+
|
|
434
|
+
### Approval Workflow
|
|
435
|
+
All significant changes require:
|
|
436
|
+
1. Code review by designated reviewer
|
|
437
|
+
2. Security scan passing
|
|
438
|
+
3. Test coverage > 80%
|
|
439
|
+
4. Documentation update
|
|
440
|
+
5. Change request ticket linked
|
|
441
|
+
|
|
442
|
+
### Change Classification
|
|
443
|
+
|
|
444
|
+
| Class | Approval | Review Time | Examples |
|
|
445
|
+
|-------|----------|-------------|----------|
|
|
446
|
+
| Standard | Auto | <1 hour | Bug fixes, docs, config |
|
|
447
|
+
| Normal | 1 reviewer | <4 hours | Features, refactoring |
|
|
448
|
+
| Major | 2 reviewers | <24 hours | Architecture, security |
|
|
449
|
+
| Emergency | Skip + post-review | Immediate | Production hotfix |
|
|
450
|
+
|
|
451
|
+
### Audit Trail
|
|
452
|
+
All agent actions are logged to:
|
|
453
|
+
- \`/logs/agent-actions.log\` - Local file log
|
|
454
|
+
- \`/logs/audit.json\` - Structured JSON log
|
|
455
|
+
- Central audit system (if configured via AUDIT_ENDPOINT)
|
|
456
|
+
|
|
457
|
+
\`\`\`bash
|
|
458
|
+
# View recent agent actions
|
|
459
|
+
npx @claude-flow/cli logs --type agent-actions --last 1h
|
|
460
|
+
|
|
461
|
+
# Export audit log
|
|
462
|
+
npx @claude-flow/cli logs export --format json --output audit.json
|
|
463
|
+
\`\`\`
|
|
464
|
+
|
|
465
|
+
### Compliance
|
|
466
|
+
|
|
467
|
+
#### SOC2 Controls
|
|
468
|
+
- All actions timestamped with actor ID
|
|
469
|
+
- Immutable audit log retention (90 days minimum)
|
|
470
|
+
- Access control for sensitive operations
|
|
471
|
+
- Automated security scanning
|
|
472
|
+
|
|
473
|
+
#### GDPR Data Handling
|
|
474
|
+
- PII detection and masking in logs
|
|
475
|
+
- Data minimization in memory storage
|
|
476
|
+
- Right to erasure support in AgentDB
|
|
477
|
+
- Cross-border transfer controls
|
|
478
|
+
|
|
479
|
+
#### PCI-DSS (if applicable)
|
|
480
|
+
- No storage of card data in agent memory
|
|
481
|
+
- Encrypted communication for sensitive data
|
|
482
|
+
- Access logging for cardholder data operations
|
|
483
|
+
- Quarterly security reviews
|
|
484
|
+
|
|
485
|
+
### Role-Based Access Control (RBAC)
|
|
486
|
+
|
|
487
|
+
| Role | Permissions |
|
|
488
|
+
|------|-------------|
|
|
489
|
+
| Developer | Read, write source code, run tests |
|
|
490
|
+
| Lead | Developer + approve PRs, deploy to staging |
|
|
491
|
+
| Admin | Lead + deploy to production, manage config |
|
|
492
|
+
| Security | Audit logs, security scans, CVE remediation |
|
|
493
|
+
| Observer | Read-only access to logs and metrics |
|
|
494
|
+
|
|
495
|
+
\`\`\`bash
|
|
496
|
+
# Check current role
|
|
497
|
+
npx @claude-flow/cli claims list
|
|
498
|
+
|
|
499
|
+
# Request elevated permissions
|
|
500
|
+
npx @claude-flow/cli claims request --permission deploy:production
|
|
501
|
+
\`\`\`
|
|
502
|
+
|
|
503
|
+
## Service Level Agreements (SLAs)
|
|
504
|
+
|
|
505
|
+
### Agent Response Times
|
|
506
|
+
|
|
507
|
+
| Operation | Target | Max | Escalation |
|
|
508
|
+
|-----------|--------|-----|------------|
|
|
509
|
+
| Code generation | <5s | 30s | Alert on-call |
|
|
510
|
+
| Memory search | <100ms | 500ms | Log warning |
|
|
511
|
+
| Security scan | <60s | 5min | Queue retry |
|
|
512
|
+
| Test execution | <2min | 10min | Split test suite |
|
|
513
|
+
|
|
514
|
+
### Availability Targets
|
|
515
|
+
- Agent availability: 99.9% uptime
|
|
516
|
+
- Memory system: 99.99% availability
|
|
517
|
+
- MCP server: 99.5% uptime
|
|
518
|
+
|
|
519
|
+
## Incident Response
|
|
520
|
+
|
|
521
|
+
### Severity Levels
|
|
522
|
+
|
|
523
|
+
| Level | Description | Response Time | Notification |
|
|
524
|
+
|-------|-------------|---------------|--------------|
|
|
525
|
+
| P1 | Production down | <15 min | Page on-call |
|
|
526
|
+
| P2 | Major feature broken | <1 hour | Slack alert |
|
|
527
|
+
| P3 | Minor issue | <4 hours | Email |
|
|
528
|
+
| P4 | Cosmetic/docs | Next sprint | Ticket |
|
|
529
|
+
|
|
530
|
+
### On Security Issue
|
|
531
|
+
1. **Contain** - Immediately stop affected agents
|
|
532
|
+
\`\`\`bash
|
|
533
|
+
npx @claude-flow/cli agent stop --all --force
|
|
534
|
+
\`\`\`
|
|
535
|
+
2. **Isolate** - Quarantine compromised resources
|
|
536
|
+
3. **Document** - Record timeline in incident log
|
|
537
|
+
4. **Notify** - Alert security team via configured channel
|
|
538
|
+
5. **Remediate** - Apply fix with expedited review
|
|
539
|
+
6. **Review** - Post-incident analysis within 48 hours
|
|
540
|
+
|
|
541
|
+
### On Production Bug
|
|
542
|
+
1. **Assess** - Determine impact and scope
|
|
543
|
+
2. **Decide** - Roll back if safe, or forward-fix
|
|
544
|
+
\`\`\`bash
|
|
545
|
+
# Rollback
|
|
546
|
+
npx @claude-flow/cli deployment rollback --env production
|
|
547
|
+
|
|
548
|
+
# Or forward-fix
|
|
549
|
+
npx @claude-flow/cli workflow run hotfix
|
|
550
|
+
\`\`\`
|
|
551
|
+
3. **Document** - Capture reproduction steps
|
|
552
|
+
4. **Fix** - Create hotfix on dedicated branch
|
|
553
|
+
5. **Validate** - Full regression test suite
|
|
554
|
+
6. **Deploy** - With expedited review process
|
|
555
|
+
|
|
556
|
+
### Communication Templates
|
|
557
|
+
|
|
558
|
+
\`\`\`markdown
|
|
559
|
+
# Incident Started
|
|
560
|
+
**Status**: Investigating
|
|
561
|
+
**Impact**: [Brief description]
|
|
562
|
+
**Started**: [Timestamp]
|
|
563
|
+
**Next Update**: [ETA]
|
|
564
|
+
|
|
565
|
+
# Incident Resolved
|
|
566
|
+
**Status**: Resolved
|
|
567
|
+
**Impact**: [Summary]
|
|
568
|
+
**Duration**: [Time]
|
|
569
|
+
**Root Cause**: [Brief description]
|
|
570
|
+
**Prevention**: [Actions taken]
|
|
571
|
+
\`\`\`
|
|
572
|
+
|
|
573
|
+
## Disaster Recovery
|
|
574
|
+
|
|
575
|
+
### Backup Strategy
|
|
576
|
+
- **Memory DB**: Hourly snapshots, 7-day retention
|
|
577
|
+
- **Configuration**: Version controlled, immutable
|
|
578
|
+
- **Agent State**: Checkpoint every 10 tasks
|
|
579
|
+
|
|
580
|
+
### Recovery Procedures
|
|
581
|
+
\`\`\`bash
|
|
582
|
+
# Restore from backup
|
|
583
|
+
npx @claude-flow/cli memory restore --snapshot latest
|
|
584
|
+
|
|
585
|
+
# Restore specific checkpoint
|
|
586
|
+
npx @claude-flow/cli session restore --checkpoint <id>
|
|
587
|
+
\`\`\`
|
|
588
|
+
|
|
589
|
+
### Recovery Time Objectives
|
|
590
|
+
| Component | RTO | RPO |
|
|
591
|
+
|-----------|-----|-----|
|
|
592
|
+
| Memory DB | <1 hour | <1 hour |
|
|
593
|
+
| Agent State | <15 min | <10 tasks |
|
|
594
|
+
| Configuration | <5 min | 0 (git) |
|
|
595
|
+
|
|
596
|
+
## Monitoring & Alerting
|
|
597
|
+
|
|
598
|
+
### Key Metrics
|
|
599
|
+
- Agent task completion rate
|
|
600
|
+
- Average response latency
|
|
601
|
+
- Error rate by type
|
|
602
|
+
- Memory usage trends
|
|
603
|
+
- Security scan findings
|
|
604
|
+
|
|
605
|
+
### Alert Thresholds
|
|
606
|
+
\`\`\`yaml
|
|
607
|
+
alerts:
|
|
608
|
+
- name: high_error_rate
|
|
609
|
+
condition: error_rate > 5%
|
|
610
|
+
duration: 5m
|
|
611
|
+
severity: critical
|
|
612
|
+
|
|
613
|
+
- name: slow_response
|
|
614
|
+
condition: p99_latency > 10s
|
|
615
|
+
duration: 10m
|
|
616
|
+
severity: warning
|
|
617
|
+
|
|
618
|
+
- name: memory_pressure
|
|
619
|
+
condition: memory_usage > 90%
|
|
620
|
+
duration: 1m
|
|
621
|
+
severity: critical
|
|
622
|
+
\`\`\`
|
|
623
|
+
|
|
624
|
+
## Training & Onboarding
|
|
625
|
+
|
|
626
|
+
### New Team Member Checklist
|
|
627
|
+
- [ ] Read this AGENTS.md document
|
|
628
|
+
- [ ] Complete security awareness training
|
|
629
|
+
- [ ] Set up local development environment
|
|
630
|
+
- [ ] Run \`npx @claude-flow/cli doctor\` to verify setup
|
|
631
|
+
- [ ] Complete first guided task with mentor
|
|
632
|
+
- [ ] Review incident response procedures
|
|
633
|
+
|
|
634
|
+
### Knowledge Base
|
|
635
|
+
- Internal wiki: [Link to wiki]
|
|
636
|
+
- Architecture Decision Records: \`/docs/adr/\`
|
|
637
|
+
- Runbooks: \`/docs/runbooks/\`
|
|
638
|
+
`;
|
|
639
|
+
return full + enterpriseSections;
|
|
640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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+M5B,CAAC;IAEA,OAAO,IAAI,GAAG,kBAAkB,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @claude-flow/codex - config.toml Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates Codex CLI configuration files in TOML format
|
|
5
|
+
*/
|
|
6
|
+
import type { ConfigTomlOptions } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Security configuration options
|
|
9
|
+
*/
|
|
10
|
+
interface SecurityConfig {
|
|
11
|
+
inputValidation?: boolean;
|
|
12
|
+
pathTraversal?: boolean;
|
|
13
|
+
secretScanning?: boolean;
|
|
14
|
+
cveScanning?: boolean;
|
|
15
|
+
maxFileSize?: number;
|
|
16
|
+
allowedExtensions?: string[];
|
|
17
|
+
blockedPatterns?: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Performance configuration options
|
|
21
|
+
*/
|
|
22
|
+
interface PerformanceConfig {
|
|
23
|
+
maxAgents?: number;
|
|
24
|
+
taskTimeout?: number;
|
|
25
|
+
memoryLimit?: string;
|
|
26
|
+
cacheEnabled?: boolean;
|
|
27
|
+
cacheTtl?: number;
|
|
28
|
+
parallelExecution?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Logging configuration options
|
|
32
|
+
*/
|
|
33
|
+
interface LoggingConfig {
|
|
34
|
+
level?: 'debug' | 'info' | 'warn' | 'error';
|
|
35
|
+
format?: 'json' | 'text' | 'pretty';
|
|
36
|
+
destination?: 'stdout' | 'file' | 'both';
|
|
37
|
+
filePath?: string;
|
|
38
|
+
maxFiles?: number;
|
|
39
|
+
maxSize?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Extended configuration options
|
|
43
|
+
*/
|
|
44
|
+
interface ExtendedConfigTomlOptions extends ConfigTomlOptions {
|
|
45
|
+
security?: SecurityConfig;
|
|
46
|
+
performance?: PerformanceConfig;
|
|
47
|
+
logging?: LoggingConfig;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generate a config.toml file based on the provided options
|
|
51
|
+
*/
|
|
52
|
+
export declare function generateConfigToml(options?: ExtendedConfigTomlOptions): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Generate minimal config.toml
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateMinimalConfigToml(options?: ConfigTomlOptions): Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Generate CI/CD config.toml
|
|
59
|
+
*/
|
|
60
|
+
export declare function generateCIConfigToml(): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Generate enterprise config.toml with full governance
|
|
63
|
+
*/
|
|
64
|
+
export declare function generateEnterpriseConfigToml(): Promise<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Generate development config.toml with permissive settings
|
|
67
|
+
*/
|
|
68
|
+
export declare function generateDevConfigToml(): Promise<string>;
|
|
69
|
+
/**
|
|
70
|
+
* Generate security-focused config.toml
|
|
71
|
+
*/
|
|
72
|
+
export declare function generateSecureConfigToml(): Promise<string>;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=config-toml.d.ts.map
|