Skip to content

Commit 494b8df

Browse files
github-actions[bot]Claude Documentation Agentclaude
authored
Update documentation for power_steering_checker refactoring and Copilot CLI support (#2911)
## Changes ### Power-Steering Documentation (docs/features/power-steering/README.md) - Updated Architecture section to reflect modular 12-file package structure - Added changelog entry for v0.10.0 (2026-03-07) with refactoring details - Documented Copilot CLI transcript support - Highlighted 76% LOC reduction (5,063 → 1,217 lines in largest module) - Added module responsibility descriptions and cross-references ### API Reference (docs/reference/power-steering-checker-api.md) - Added refactoring summary to Package Overview section - Documented 191 tests passing (121 existing + 48 parser + 22 Copilot e2e) - Noted CLAUDECODE environment variable fix for nested sessions - Cross-referenced power_steering_checker package README ### Copilot CLI Integration (docs/COPILOT_CLI.md) - Bumped version to 1.1.0 (from 1.0.0) - Added new "Copilot CLI Transcript Support" section to ToC - Documented auto-detection of Claude Code vs Copilot CLI transcript formats - Explained module structure and testing coverage - Highlighted benefits for Copilot CLI users (session completion validation) ## Context Following Diátaxis framework: - **Explanation**: Architecture changes in Power-Steering docs - **Reference**: API updates in reference documentation - **Tutorial**: Usage guidance in Copilot CLI integration docs Based on merged PRs from 2026-03-06 to 2026-03-07: - PR #2910: Major refactoring into modular package - PR #2887: Bash template quoting fix - PR #2886: JSON handling in quality-audit-cycle Co-authored-by: Claude Documentation Agent <claude-agent@amplihack.github.io> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e9cf95d commit 494b8df

3 files changed

Lines changed: 154 additions & 6 deletions

File tree

docs/COPILOT_CLI.md

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# GitHub Copilot CLI Integration with amplihack
22

3-
**Version**: 1.0.0
4-
**Status**: Complete Integration
5-
**Last Updated**: 2026-01-16
3+
**Version**: 1.1.0
4+
**Status**: Complete Integration (with Copilot CLI Transcript Support)
5+
**Last Updated**: 2026-03-07
66

77
## Overview
88

99
This document describes the complete integration between GitHub Copilot CLI and the amplihack agentic coding framework. The integration provides Copilot users with access to amplihack's agents, skills, workflows, and MCP servers.
1010

11+
**New in v1.1.0 (2026-03-07)**: Native Copilot CLI transcript support in Power-Steering checker. The checker now auto-detects and parses both Claude Code and GitHub Copilot CLI transcript formats (real `events.jsonl` format), enabling session completion validation across both platforms.
12+
1113
## Table of Contents
1214

15+
- [Copilot CLI Transcript Support](#copilot-cli-transcript-support)
1316
- [Architecture](#architecture)
1417
- [Quick Start](#quick-start)
1518
- [Integration Components](#integration-components)
@@ -27,6 +30,89 @@ This document describes the complete integration between GitHub Copilot CLI and
2730

2831
Copilot CLI agents are **authored by the amplihack project** and stored in `~/.amplihack/.claude/agents/amplihack/`. When you run `amplihack copilot`, the framework symlinks these agents into `.github/agents/` so GitHub Copilot CLI can discover them. You don't need to write agents yourself — amplihack provides 30+ specialized agents (architect, builder, reviewer, tester, security, etc.) that Copilot can delegate to.
2932

33+
## Copilot CLI Transcript Support
34+
35+
**New in v1.1.0 (2026-03-07)**: Power-Steering now natively supports GitHub Copilot CLI session transcripts.
36+
37+
### What Changed
38+
39+
The `power_steering_checker` package has been refactored from a monolithic 5,063-line file into 12 focused modules with automatic transcript format detection:
40+
41+
- **Auto-Detection**: Automatically detects whether a transcript is from Claude Code or GitHub Copilot CLI
42+
- **Copilot CLI Format**: Parses real `events.jsonl` format used by GitHub Copilot CLI
43+
- **Backward Compatible**: All existing Claude Code transcripts continue to work
44+
- **Tested**: 48 new parser tests + 22 Copilot CLI end-to-end tests (verified against 5 real Copilot sessions)
45+
46+
### How It Works
47+
48+
```
49+
Session Transcript → Transcript Parser → Power-Steering Checker
50+
51+
Auto-detect format:
52+
- Claude Code JSONL
53+
- Copilot CLI events.jsonl
54+
55+
Parse appropriately
56+
57+
Validate session completion
58+
```
59+
60+
### Key Features
61+
62+
1. **Format Auto-Detection**: No configuration needed - the parser detects the format automatically
63+
2. **SDK Call Safety**: CLAUDECODE environment variable properly unset to prevent nested session errors
64+
3. **Progress Tracking**: Works with both transcript formats for session completion validation
65+
4. **Error Resilience**: Fail-open design ensures checker never blocks due to parsing errors
66+
67+
### Module Structure
68+
69+
The refactored checker is organized into specialized modules:
70+
71+
- `main_checker.py` — Orchestration + public API (1,217 lines, 76% reduction)
72+
- `transcript_parser.py` — Format detection + parsing (both Claude Code and Copilot CLI)
73+
- `session_detection.py` — Session type classification
74+
- `considerations.py` — Check configuration + evaluation
75+
- `sdk_calls.py` — Claude SDK integration + parallel analysis
76+
- `progress_tracking.py` — State persistence + redirect records
77+
- `result_formatting.py` — Output generation
78+
- Plus 5 check-specific modules
79+
80+
See [power_steering_checker README](../.claude/tools/amplihack/hooks/power_steering_checker/README.md) for complete module documentation.
81+
82+
### Testing
83+
84+
All Copilot CLI transcript support is thoroughly tested:
85+
86+
```bash
87+
# Run parser tests
88+
pytest .claude/tools/amplihack/hooks/power_steering_checker/tests/test_transcript_parser.py
89+
90+
# Run Copilot CLI integration tests
91+
pytest .claude/tools/amplihack/hooks/tests/test_power_steering_copilot_cli.py
92+
93+
# Total test coverage
94+
# - 121 existing tests (backward compatibility)
95+
# - 48 parser tests (format detection + parsing)
96+
# - 22 Copilot CLI e2e tests (real session validation)
97+
# = 191 tests passing
98+
```
99+
100+
### Benefits for Copilot CLI Users
101+
102+
1. **Session Completion Validation**: Power-Steering now works in Copilot CLI sessions
103+
2. **Quality Enforcement**: Same 21 considerations apply (TODOs, tests, CI, PR quality, etc.)
104+
3. **No Configuration**: Auto-detection means zero setup required
105+
4. **Cross-Platform**: Same checker logic works in both Claude Code and Copilot CLI
106+
107+
### Migration Notes
108+
109+
**No action required** - if you're already using amplihack with Copilot CLI, the transcript support is automatically enabled. The checker will:
110+
111+
1. Detect you're using Copilot CLI (via transcript format)
112+
2. Parse the `events.jsonl` format correctly
113+
3. Apply the same 21 considerations as Claude Code
114+
4. Provide session completion validation
115+
30116
## Architecture
31117

32118
### Directory Structure

docs/features/power-steering/README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,20 @@ gh pr view --json statusCheckRollup
423423
```
424424
.claude/tools/amplihack/
425425
├── hooks/
426-
│ ├── power_steering_checker.py # Core checker logic
426+
│ ├── power_steering_checker/ # Modular checker package
427+
│ │ ├── __init__.py # Public API re-exports
428+
│ │ ├── main_checker.py # PowerSteeringChecker orchestration (1,217 lines)
429+
│ │ ├── considerations.py # Dataclasses + ConsiderationsMixin
430+
│ │ ├── sdk_calls.py # SdkCallsMixin + SDK integration
431+
│ │ ├── progress_tracking.py # ProgressTrackingMixin + state I/O
432+
│ │ ├── result_formatting.py # ResultFormattingMixin + output generation
433+
│ │ ├── checks_ci_pr.py # CI/PR-specific checks
434+
│ │ ├── checks_docs.py # Documentation checks
435+
│ │ ├── checks_quality.py # Code quality checks
436+
│ │ ├── checks_workflow.py # Workflow adherence checks
437+
│ │ ├── session_detection.py # Session type detection
438+
│ │ ├── transcript_parser.py # Transcript parsing (Claude Code + Copilot CLI)
439+
│ │ └── transcript_helpers.py # Transcript utility functions
427440
│ ├── power_steering_state.py # State management
428441
│ └── templates/
429442
│ └── power_steering_prompt.txt # User-facing messages
@@ -432,6 +445,13 @@ gh pr view --json statusCheckRollup
432445
└── USER_PREFERENCES.md # User preferences
433446
```
434447

448+
**Architecture Highlights**:
449+
- **Modular Design**: Split from monolithic 5,063-line file into 12 focused modules (largest: 1,217 lines)
450+
- **Backward Compatible**: All existing imports continue to work via `__init__.py` re-exports
451+
- **Copilot CLI Support**: Auto-detects and parses both Claude Code and GitHub Copilot CLI transcripts (real `events.jsonl` format)
452+
- **Import-Time Safe**: CLAUDECODE environment variable unset to prevent nested session errors in SDK calls
453+
- **Independently Testable**: 191 unit/integration tests (121 existing + 48 parser + 22 Copilot e2e)
454+
435455
### Checker Methods
436456

437457
| Method | Purpose | Evidence |
@@ -444,6 +464,15 @@ gh pr view --json statusCheckRollup
444464

445465
**Generic checker**: For custom considerations, uses keyword extraction and transcript search.
446466

467+
**Module Responsibilities**:
468+
- `considerations.py` — Data models + consideration loading/evaluation
469+
- `sdk_calls.py` — Claude SDK integration + parallel analysis + timeouts
470+
- `progress_tracking.py` — State persistence + redirect records + compaction
471+
- `result_formatting.py` — Text formatting + output generation
472+
- `main_checker.py` — Orchestration + public API
473+
474+
See [power_steering_checker package README](../../../.claude/tools/amplihack/hooks/power_steering_checker/README.md) for detailed module documentation.
475+
447476
### State Management
448477

449478
Power-Steering maintains minimal state:
@@ -505,7 +534,33 @@ Power-Steering maintains minimal state:
505534

506535
## Changelog
507536

508-
### v0.10.0 (Planned)
537+
### v0.10.0 (2026-03-07)
538+
539+
**Refactored** (PR #2910):
540+
541+
- **Modular Architecture**: Split monolithic `power_steering_checker.py` (5,063 lines) into 12 focused modules
542+
- Largest module: `main_checker.py` at 1,217 lines (76% reduction)
543+
- Improved maintainability and testability
544+
- All existing imports remain backward compatible via `__init__.py` re-exports
545+
- **Copilot CLI Support**: Auto-detection and parsing of GitHub Copilot CLI transcripts
546+
- Supports real `events.jsonl` format
547+
- Verified against 5 real Copilot CLI sessions
548+
- 48 new parser tests + 22 Copilot e2e tests
549+
- **SDK Integration Fix**: CLAUDECODE environment variable now properly unset to prevent nested session errors
550+
- Affects all Claude SDK subprocess calls
551+
- Applied to both `.claude/` and `amplifier-bundle/` copies
552+
553+
**Testing**:
554+
555+
- 191 unit/integration tests passing (121 existing + 48 parser + 22 Copilot e2e)
556+
- Quality audit cycle completed (3-agent validation)
557+
558+
**Fixed** (PR #2887, #2886):
559+
560+
- Bash template quoting in quality-audit-cycle (double-quote escaping issue)
561+
- JSON-as-commands execution in verify-fixes step
562+
563+
### v0.9.2 (Planned)
509564

510565
**Added**:
511566

docs/reference/power-steering-checker-api.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ Complete API reference for the `power_steering_checker` package.
1414
.claude/tools/amplihack/hooks/power_steering_checker/
1515
```
1616

17-
It is structured as five focused modules assembled by a re-exporting `__init__.py` that preserves full backward compatibility with the previous single-file layout.
17+
**Recent Refactoring (v0.10.0, 2026-03-07)**: Split from a monolithic 5,063-line `power_steering_checker.py` into 12 focused modules (largest: 1,217 lines). The refactoring includes:
18+
- Modular architecture with clear separation of concerns
19+
- Copilot CLI transcript support (auto-detects both Claude Code and GitHub Copilot CLI formats)
20+
- CLAUDECODE environment variable properly unset to prevent nested session errors
21+
- 191 tests passing (121 existing + 48 parser + 22 Copilot e2e)
22+
- Full backward compatibility via re-exporting `__init__.py`
23+
24+
See [power_steering_checker package README](../../.claude/tools/amplihack/hooks/power_steering_checker/README.md) for module details.
1825

1926
---
2027

0 commit comments

Comments
 (0)