ace-handbook 0.19.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.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.ace-defaults/handbook/config.yml +4 -0
  3. data/.ace-defaults/nav/protocols/guide-sources/ace-handbook.yml +19 -0
  4. data/.ace-defaults/nav/protocols/tmpl-sources/ace-handbook.yml +10 -0
  5. data/.ace-defaults/nav/protocols/wfi-sources/ace-handbook.yml +19 -0
  6. data/CHANGELOG.md +362 -0
  7. data/LICENSE +21 -0
  8. data/README.md +42 -0
  9. data/Rakefile +12 -0
  10. data/exe/ace-handbook +6 -0
  11. data/handbook/guides/ai-agent-integration.g.md +625 -0
  12. data/handbook/guides/atom-pattern.g.md +371 -0
  13. data/handbook/guides/changelog.g.md +333 -0
  14. data/handbook/guides/cli-dry-cli.g.md +276 -0
  15. data/handbook/guides/cli-support-cli.g.md +277 -0
  16. data/handbook/guides/coding-standards/ruby.md +41 -0
  17. data/handbook/guides/coding-standards/rust.md +19 -0
  18. data/handbook/guides/coding-standards/typescript.md +20 -0
  19. data/handbook/guides/coding-standards.g.md +134 -0
  20. data/handbook/guides/debug-troubleshooting.g.md +62 -0
  21. data/handbook/guides/error-handling/ruby.md +29 -0
  22. data/handbook/guides/error-handling/rust.md +59 -0
  23. data/handbook/guides/error-handling/typescript.md +38 -0
  24. data/handbook/guides/error-handling.g.md +207 -0
  25. data/handbook/guides/meta/agents-definition.g.md +823 -0
  26. data/handbook/guides/meta/guides-definition.g.md +322 -0
  27. data/handbook/guides/meta/markdown-definition.g.md +210 -0
  28. data/handbook/guides/meta/tools-definition.g.md +159 -0
  29. data/handbook/guides/meta/workflow-instructions-definition.g.md +367 -0
  30. data/handbook/guides/mono-repo-patterns.g.md +92 -0
  31. data/handbook/guides/multi-agent-research.g.md +251 -0
  32. data/handbook/guides/performance/ruby.md +25 -0
  33. data/handbook/guides/performance/rust.md +48 -0
  34. data/handbook/guides/performance/typescript.md +32 -0
  35. data/handbook/guides/performance.g.md +211 -0
  36. data/handbook/guides/prompt-caching.g.md +83 -0
  37. data/handbook/guides/quality-assurance/ruby.md +33 -0
  38. data/handbook/guides/quality-assurance/rust.md +41 -0
  39. data/handbook/guides/quality-assurance/typescript.md +49 -0
  40. data/handbook/guides/quality-assurance.g.md +222 -0
  41. data/handbook/guides/strategic-planning.g.md +69 -0
  42. data/handbook/guides/troubleshooting/ruby.md +21 -0
  43. data/handbook/guides/troubleshooting/rust.md +20 -0
  44. data/handbook/guides/troubleshooting/typescript.md +36 -0
  45. data/handbook/guides/workflow-context-embedding.g.md +286 -0
  46. data/handbook/skills/as-handbook-init-project/SKILL.md +34 -0
  47. data/handbook/skills/as-handbook-manage-agents/SKILL.md +35 -0
  48. data/handbook/skills/as-handbook-manage-guides/SKILL.md +35 -0
  49. data/handbook/skills/as-handbook-manage-workflows/SKILL.md +35 -0
  50. data/handbook/skills/as-handbook-parallel-research/SKILL.md +29 -0
  51. data/handbook/skills/as-handbook-perform-delivery/SKILL.md +35 -0
  52. data/handbook/skills/as-handbook-review-guides/SKILL.md +32 -0
  53. data/handbook/skills/as-handbook-review-workflows/SKILL.md +32 -0
  54. data/handbook/skills/as-handbook-synthesize-research/SKILL.md +29 -0
  55. data/handbook/skills/as-handbook-update-docs/SKILL.md +35 -0
  56. data/handbook/skills/as-release/SKILL.md +50 -0
  57. data/handbook/skills/as-release-bump-version/SKILL.md +28 -0
  58. data/handbook/skills/as-release-rubygems-publish/SKILL.md +58 -0
  59. data/handbook/skills/as-release-update-changelog/SKILL.md +28 -0
  60. data/handbook/templates/completed-work-documentation.md +59 -0
  61. data/handbook/templates/cookbooks/cookbook.template.md +237 -0
  62. data/handbook/templates/research-comparison.template.md +175 -0
  63. data/handbook/workflow-instructions/handbook/init-project.wf.md +629 -0
  64. data/handbook/workflow-instructions/handbook/manage-agents.wf.md +379 -0
  65. data/handbook/workflow-instructions/handbook/manage-guides.wf.md +294 -0
  66. data/handbook/workflow-instructions/handbook/manage-workflows.wf.md +292 -0
  67. data/handbook/workflow-instructions/handbook/parallel-research.wf.md +328 -0
  68. data/handbook/workflow-instructions/handbook/perform-delivery.wf.md +267 -0
  69. data/handbook/workflow-instructions/handbook/research.wf.md +247 -0
  70. data/handbook/workflow-instructions/handbook/review-guides.wf.md +348 -0
  71. data/handbook/workflow-instructions/handbook/review-workflows.wf.md +299 -0
  72. data/handbook/workflow-instructions/handbook/synthesize-research.wf.md +429 -0
  73. data/handbook/workflow-instructions/handbook/update-docs.wf.md +338 -0
  74. data/lib/ace/handbook/atoms/provider_registry.rb +70 -0
  75. data/lib/ace/handbook/cli/commands/status.rb +36 -0
  76. data/lib/ace/handbook/cli/commands/sync.rb +36 -0
  77. data/lib/ace/handbook/cli.rb +51 -0
  78. data/lib/ace/handbook/models/skill_document.rb +25 -0
  79. data/lib/ace/handbook/molecules/skill_projection.rb +54 -0
  80. data/lib/ace/handbook/organisms/provider_syncer.rb +106 -0
  81. data/lib/ace/handbook/organisms/skill_inventory.rb +54 -0
  82. data/lib/ace/handbook/organisms/status_collector.rb +181 -0
  83. data/lib/ace/handbook/version.rb +7 -0
  84. data/lib/ace/handbook.rb +28 -0
  85. metadata +227 -0
@@ -0,0 +1,625 @@
1
+ ---
2
+ doc-type: guide
3
+ title: AI Agent Integration Guide
4
+ purpose: Documentation for ace-handbook/handbook/guides/ai-agent-integration.g.md
5
+ ace-docs:
6
+ last-updated: 2026-01-08
7
+ last-checked: 2026-03-21
8
+ ---
9
+
10
+ # AI Agent Integration Guide
11
+
12
+ ## Overview
13
+
14
+ This guide provides comprehensive instructions for integrating AI agents into development workflows, covering command wrapper
15
+ patterns, context management, error handling, and best practices derived from extensive analysis of AI agent usage patterns.
16
+
17
+ ## Table of Contents
18
+
19
+ 1. [Quick Start](#quick-start)
20
+ 2. [Command Wrapper Patterns](#command-wrapper-patterns)
21
+ 3. [Context Management](#context-management)
22
+ 4. [Error Handling](#error-handling)
23
+ 5. [Common Pain Points](#common-pain-points)
24
+ 6. [Best Practices](#best-practices)
25
+ 7. [Troubleshooting](#troubleshooting)
26
+ 8. [Examples](#examples)
27
+
28
+ ## Quick Start
29
+
30
+ ### Prerequisites
31
+
32
+ - Access to project repository with workflow instructions
33
+ - Understanding of project structure and submodules
34
+ - Familiarity with CLI tools and Git operations
35
+
36
+ ### Essential Commands
37
+
38
+ ```bash
39
+ # Find next task to work on
40
+ task-manager next
41
+
42
+ # Review recent tasks
43
+ task-manager recent
44
+
45
+ # Get current release context
46
+ release-manager current
47
+
48
+ # Run tests and validation
49
+ # Note: test and lint commands are project-specific
50
+ # Check your project's package.json, Gemfile, or Makefile
51
+
52
+ # Multi-repository operations
53
+ git-status # git status across all repos
54
+ git-commit -i "intention" # coordinated commits
55
+ ```
56
+
57
+ ### Initial Setup
58
+
59
+ 1. **Verify Project Structure**
60
+
61
+ ```bash
62
+ # Always verify file locations before operations
63
+ ls dev-taskflow/current/
64
+ find . -name "*.wf.md" -type f
65
+ ```
66
+
67
+ 2. **Check Submodules**
68
+
69
+ ```bash
70
+ git submodule update --init --recursive
71
+ ```
72
+
73
+ 3. **Validate Environment**
74
+
75
+ ```bash
76
+ # Run project-specific test and lint commands
77
+ # Examples: npm test, bundle exec rspec, pytest
78
+ # Check package.json, Gemfile, or Makefile for exact commands
79
+ ```
80
+
81
+ ## Command Wrapper Patterns
82
+
83
+ ### @work-on-task Pattern
84
+
85
+ **Purpose**: Systematic task execution with validation and todo management
86
+
87
+ **Usage**:
88
+
89
+ ```bash
90
+ # Follow work-on-task workflow
91
+ @work-on-task dev-taskflow/current/v.X.Y.Z-release/tasks/task-file.md
92
+ ```
93
+
94
+ **Key Components**:
95
+
96
+ - Todo list management for progress tracking
97
+ - Embedded test validation at each step
98
+ - Plan mode for user approval
99
+ - Systematic completion verification
100
+
101
+ **Example Implementation**:
102
+
103
+ ```markdown
104
+ ## Implementation Plan
105
+
106
+ ### Planning Steps
107
+ * [ ] Research existing patterns
108
+ > TEST: Pattern Analysis Complete
109
+ > Type: Pre-condition Check
110
+ > Assert: Patterns documented
111
+ > Command: ls patterns/
112
+
113
+ ### Execution Steps
114
+ - [ ] Implement feature
115
+ > TEST: Feature Validation
116
+ > Type: Action Validation
117
+ > Assert: Tests pass
118
+ > Command: # Run project-specific test command
119
+ ```
120
+
121
+ ### @review-code Pattern
122
+
123
+ **Purpose**: Multi-file analysis with structured XML packaging
124
+
125
+ **Usage**:
126
+
127
+ ```bash
128
+ # Review multiple workflow files
129
+ @review-code workflows
130
+ ```
131
+
132
+ **Architecture**:
133
+
134
+ - XML packaging for structured content
135
+ - Semantic tags for organization
136
+ - Comprehensive analysis reports
137
+
138
+ **XML Structure**:
139
+
140
+ ```xml
141
+ <project-context>
142
+ <focus-areas>
143
+ <focus>Primary analysis target</focus>
144
+ </focus-areas>
145
+ <documents>
146
+ <document path="file1.md">
147
+ <![CDATA[content]]>
148
+ </document>
149
+ </documents>
150
+ </project-context>
151
+ ```
152
+
153
+ ### @handbook-review Pattern
154
+
155
+ **Purpose**: Multi-model review orchestration
156
+
157
+ **Usage**:
158
+
159
+ ```bash
160
+ # Systematic workflow analysis
161
+ @handbook-review workflows
162
+ ```
163
+
164
+ **Features**:
165
+
166
+ - Cost-effective multi-model comparisons
167
+ - System prompt separation
168
+ - Structured analysis reports
169
+
170
+ ### Multi-Repository Commands
171
+
172
+ **Purpose**: Coordinated operations across main + submodules
173
+
174
+ **Usage**:
175
+
176
+ ```bash
177
+ # Intention-based commits across all repos
178
+ git-commit -i "implement feature X"
179
+
180
+ # Status across all repositories
181
+ git-status
182
+
183
+ # Logs across all repositories
184
+ git-log
185
+ ```
186
+
187
+ ## Context Management
188
+
189
+ ### File Path Validation
190
+
191
+ **Problem**: AI agents frequently assume file locations without verification
192
+
193
+ **Solution**: Always verify before operations
194
+
195
+ ```bash
196
+ # Validate file existence
197
+ ls /path/to/file
198
+ ace-search "filename" --file
199
+ cd directory/ && ace-search "pattern" --content
200
+
201
+ # Use targeted file reading with context
202
+ ace-search "pattern" --content --context 3
203
+ ```
204
+
205
+ ### XML Packaging for Multi-File Analysis
206
+
207
+ **Purpose**: Structured content organization for LLM processing
208
+
209
+ **Benefits**:
210
+
211
+ - Improves LLM processing efficiency
212
+ - Maintains content structure
213
+ - Enables semantic analysis
214
+
215
+ **Template**:
216
+
217
+ ```xml
218
+ <project-context>
219
+ <focus-areas>
220
+ <focus>Specific analysis target</focus>
221
+ <focus>Secondary concern</focus>
222
+ </focus-areas>
223
+ <documents>
224
+ <document path="relative/path/file1.md">
225
+ <![CDATA[
226
+ File content here
227
+ ]]>
228
+ </document>
229
+ <document path="relative/path/file2.md">
230
+ <![CDATA[
231
+ More content here
232
+ ]]>
233
+ </document>
234
+ </documents>
235
+ </project-context>
236
+ ```
237
+
238
+ ### Session Documentation
239
+
240
+ **Structure**:
241
+
242
+ ```text
243
+ session-YYYYMMDD-HHMMSS-description/
244
+ ├── README.md # Session overview
245
+ ├── context/ # Input context
246
+ ├── analysis/ # Generated analysis
247
+ ├── outputs/ # Final deliverables
248
+ └── session-log.md # Process documentation
249
+ ```
250
+
251
+ ### Todo List Management
252
+
253
+ **Purpose**: Systematic progress tracking
254
+
255
+ **Implementation**:
256
+
257
+ ```bash
258
+ # Create and update todos
259
+ TodoWrite: [
260
+ {"id": "task-1", "content": "Description", "status": "pending", "priority": "high"},
261
+ {"id": "task-2", "content": "Description", "status": "in_progress", "priority": "medium"}
262
+ ]
263
+
264
+ # Mark completed immediately
265
+ {"id": "task-1", "status": "completed"}
266
+ ```
267
+
268
+ ## Error Handling
269
+
270
+ ### Validation-First Approach
271
+
272
+ **Pattern**: Always validate file existence before operations
273
+
274
+ **Implementation**:
275
+
276
+ ```bash
277
+ # File existence checks
278
+ if [ -f "file.md" ]; then
279
+ echo "File exists"
280
+ else
281
+ echo "File not found"
282
+ exit 1
283
+ fi
284
+
285
+ # Directory validation
286
+ if [ -d "directory/" ]; then
287
+ echo "Directory exists"
288
+ else
289
+ echo "Directory not found"
290
+ exit 1
291
+ fi
292
+ ```
293
+
294
+ ### API Reliability Management
295
+
296
+ **Problem**: External API failures disrupt workflows
297
+
298
+ **Solution**: Multi-level fallback strategies
299
+
300
+ ```bash
301
+ # API health check before expensive operations
302
+ if curl -f -s "https://api.example.com/health" > /dev/null; then
303
+ echo "API available"
304
+ else
305
+ echo "API unavailable, using fallback"
306
+ # Implement fallback logic
307
+ fi
308
+ ```
309
+
310
+ ### Timeout Configuration
311
+
312
+ **Pattern**: Configure timeouts based on content size
313
+
314
+ **Implementation**:
315
+
316
+ ```bash
317
+ # Small files: 30 seconds
318
+ # Medium files: 60 seconds
319
+ # Large files: 120 seconds
320
+ timeout 60 command_here
321
+ ```
322
+
323
+ ### Cost-Aware Processing
324
+
325
+ **Pattern**: Prioritize zero-cost operations
326
+
327
+ **Strategy**:
328
+
329
+ 1. Use direct agent capabilities first
330
+ 2. Implement cost-benefit analysis
331
+ 3. Fallback to external APIs only when necessary
332
+
333
+ ## Common Pain Points
334
+
335
+ ### 1. File Path Discovery Errors
336
+
337
+ **Problem**: Assuming file locations without verification
338
+
339
+ **Symptoms**:
340
+
341
+ - "File not found" errors
342
+ - Operations on wrong directories
343
+ - Missing files in multi-file operations
344
+
345
+ **Solution**:
346
+
347
+ ```bash
348
+ # Always verify before operations
349
+ ace-search "target-file.md" --file
350
+ ls -la expected/directory/
351
+ ace-search "search-pattern" --content
352
+ ```
353
+
354
+ ### 2. Task Completion Accuracy
355
+
356
+ **Problem**: Premature task completion without full validation
357
+
358
+ **Symptoms**:
359
+
360
+ - Tasks marked done with incomplete work
361
+ - Missing files in deliverables
362
+ - Scope creep without validation
363
+
364
+ **Solution**:
365
+
366
+ - Create explicit completion checklists
367
+ - Verify against original requirements
368
+ - Use embedded tests for validation
369
+
370
+ ### 3. Template Format Conversion
371
+
372
+ **Problem**: Complex migrations between formats
373
+
374
+ **Symptoms**:
375
+
376
+ - Four-tick vs three-tick markdown confusion
377
+ - XML template compliance issues
378
+ - Large-scale conversion errors
379
+
380
+ **Solution**:
381
+
382
+ ```bash
383
+ # Validate template synchronization
384
+ handbook sync-templates --dry-run
385
+
386
+ # Check compliance
387
+ # Run project-specific lint command
388
+ ```
389
+
390
+ ### 4. Context Token Management
391
+
392
+ **Problem**: Exceeding context limits with large files
393
+
394
+ **Symptoms**:
395
+
396
+ - Truncated responses
397
+ - Incomplete analysis
398
+ - Processing failures
399
+
400
+ **Solution**:
401
+
402
+ - Use targeted file reading
403
+ - Implement content chunking
404
+ - Prioritize relevant sections
405
+
406
+ ## Best Practices
407
+
408
+ ### 1. Systematic Workflow Following
409
+
410
+ **Principle**: AI agents perform best with documented workflows
411
+
412
+ **Implementation**:
413
+
414
+ - Use established workflow patterns consistently
415
+ - Follow work-on-task.wf.md structure
416
+ - Embed comprehensive examples
417
+
418
+ ### 2. Plan Mode Execution
419
+
420
+ **Principle**: Get user approval before major changes
421
+
422
+ **Usage**:
423
+
424
+ ```bash
425
+ # Present plan before execution
426
+ exit_plan_mode: {
427
+ "plan": "Detailed implementation plan"
428
+ }
429
+ ```
430
+
431
+ ### 3. Incremental Validation
432
+
433
+ **Principle**: Validate each step before proceeding
434
+
435
+ **Implementation**:
436
+
437
+ - Embedded tests in task plans
438
+ - File existence checks
439
+ - Completion verification
440
+
441
+ ### 4. Multi-Model Strategy
442
+
443
+ **Principle**: Leverage different AI models for optimal results
444
+
445
+ **Strategy**:
446
+
447
+ - Google Pro for cost-effective coverage
448
+ - Claude for detailed technical analysis
449
+ - Synthesis approach for insights
450
+
451
+ ## Troubleshooting
452
+
453
+ ### Common Issues
454
+
455
+ #### Issue: Command Not Found
456
+
457
+ **Symptoms**: `bin/command` results in "command not found"
458
+
459
+ **Solution**:
460
+
461
+ ```bash
462
+ # Verify script exists and is executable
463
+ ls -la bin/command
464
+ chmod +x bin/command
465
+ ```
466
+
467
+ #### Issue: File Path Errors
468
+
469
+ **Symptoms**: Operations fail with "No such file or directory"
470
+
471
+ **Solution**:
472
+
473
+ ```bash
474
+ # Use absolute paths
475
+ pwd
476
+ ls -la /full/path/to/file
477
+ ```
478
+
479
+ #### Issue: Submodule Out of Sync
480
+
481
+ **Symptoms**: Missing files in submodules
482
+
483
+ **Solution**:
484
+
485
+ ```bash
486
+ git submodule update --init --recursive
487
+ ```
488
+
489
+ #### Issue: API Authentication Failures
490
+
491
+ **Symptoms**: 401 errors from external APIs
492
+
493
+ **Solution**:
494
+
495
+ ```bash
496
+ # Check environment variables
497
+ echo $API_KEY
498
+ # Verify API key configuration
499
+ ```
500
+
501
+ ### Diagnostic Commands
502
+
503
+ ```bash
504
+ # Project health check
505
+ # Run project-specific test command
506
+ # Run project-specific lint command
507
+ git-status
508
+
509
+ # File system validation
510
+ ace-search "*.md" --file --max-results 10
511
+ ls -la dev-taskflow/current/
512
+
513
+ # Dependency verification
514
+ git submodule status
515
+ ```
516
+
517
+ ## Examples
518
+
519
+ ### Example 1: Basic Task Execution
520
+
521
+ ```bash
522
+ # 1. Find next task
523
+ task-manager next
524
+
525
+ # 2. Follow work-on-task workflow
526
+ @work-on-task dev-taskflow/current/v.0.3.0-workflows/tasks/task-file.md
527
+
528
+ # 3. Validate completion
529
+ # Run project-specific test command
530
+ # Run project-specific lint command
531
+ ```
532
+
533
+ ### Example 2: Multi-File Analysis
534
+
535
+ ```bash
536
+ # 1. Prepare XML context
537
+ cat > context.xml << 'EOF'
538
+ <project-context>
539
+ <focus-areas>
540
+ <focus>Workflow analysis</focus>
541
+ </focus-areas>
542
+ <documents>
543
+ <document path="workflow1.md">
544
+ <![CDATA[content]]>
545
+ </document>
546
+ </documents>
547
+ </project-context>
548
+ EOF
549
+
550
+ # 2. Execute analysis
551
+ @review-code workflows
552
+ ```
553
+
554
+ ### Example 3: Error Recovery
555
+
556
+ ```bash
557
+ # 1. Detect error
558
+ if ! # Run project-specific test command; then
559
+ echo "Tests failed"
560
+
561
+ # 2. Diagnose issue
562
+ # Run project-specific lint command
563
+ git status
564
+
565
+ # 3. Fix and retry
566
+ # ... fix issues ...
567
+ # Run project-specific test command
568
+ fi
569
+ ```
570
+
571
+ ### Example 4: Multi-Repository Coordination
572
+
573
+ ```bash
574
+ # 1. Check status across repos
575
+ git-status
576
+
577
+ # 2. Coordinated commit
578
+ git-commit -i "implement feature X"
579
+
580
+ # 3. Verify changes
581
+ git-log
582
+ ```
583
+
584
+ ## Advanced Patterns
585
+
586
+ ### Template-Driven Development
587
+
588
+ **Pattern**: Use templates and standardized formats
589
+
590
+ **Implementation**:
591
+
592
+ ```bash
593
+ # XML template embedding
594
+ handbook sync-templates --verbose
595
+
596
+ # Conventional commit patterns
597
+ git-commit -i "feat: add new feature"
598
+ ```
599
+
600
+ ### Context Preservation
601
+
602
+ **Pattern**: Maintain context across sessions
603
+
604
+ **Implementation**:
605
+
606
+ - Comprehensive session documentation
607
+ - Structured output directories
608
+ - Progress tracking with todos
609
+
610
+ ### Cost Optimization
611
+
612
+ **Pattern**: Minimize external API usage
613
+
614
+ **Strategy**:
615
+
616
+ 1. Use direct agent capabilities
617
+ 2. Implement caching where appropriate
618
+ 3. Batch operations efficiently
619
+
620
+ ## Conclusion
621
+
622
+ This guide provides a comprehensive framework for AI agent integration based on real-world usage patterns and proven strategies.
623
+ Success depends on systematic validation at each step, proper context management, robust error handling, cost-aware processing,
624
+ and following established workflows. By implementing these patterns and avoiding common pitfalls, AI agents can effectively
625
+ contribute to complex development workflows while maintaining reliability and efficiency.