Description
The AI-SDLC framework currently governs AI agent behavior, but it doesn't learn from how humans use those agents. We need a system that observes human-AI interaction patterns, detects repetitive workflows, and proposes deterministic automations that eliminate manual toil.
The key principle: The LLM observes and proposes, but the output is deterministic automation — shell scripts, YAML workflows, skill files. No AI in the runtime loop.
Architecture
Layer 1: Observe — Session Telemetry
- Claude Code session transcripts (available via
transcript_path in hook input)
- Tool call sequences (Bash commands, file edits, reads)
- Prompt patterns (what users ask repeatedly)
- Pipeline audit log events
- Git commit patterns and timing
Layer 2: Detect — Pattern Recognition
- Sequence mining across sessions to find repeated tool call chains
- Frequency analysis: "user runs X after Y in 80% of sessions"
- Frustration signals: repeated failed attempts, copy-paste cycles
- Time-based patterns: "every Monday the user does X"
Example patterns to detect:
- "User copied CI output to Claude to fix it 5 times on one PR" → needs
/fix-pr command
- "User always runs build+test+lint before committing" → needs pre-commit hook
- "User creates GitHub issue from Slack discussion weekly" → needs emoji trigger
- "User manually checks PR status, copies review findings, pastes to Claude" → needs automated fix-review loop
Layer 3: Propose — Automation Candidates
- Each detected pattern generates a proposal with:
- Description of the observed pattern
- Frequency and confidence score
- Proposed automation type (skill, hook, workflow, or slash command)
- Draft implementation
- Proposals are presented to the human for review
- Could be surfaced via Slack, CLI output, or a dashboard
Layer 4: Apply — Generate Deterministic Automation
- Human approves a proposal
- System generates the appropriate artifact:
.claude/skills/<name>/SKILL.md for interactive workflows
.claude/commands/<name>.md for slash commands
.claude/hooks/<name>.sh for pre/post tool hooks
.github/workflows/<name>.yml for CI/CD automations
- The automation is committed as code — version-controlled, reviewable, deterministic
- No LLM in the runtime execution path
Data Sources
| Source |
What It Captures |
Access Method |
| Claude Code transcripts |
Tool calls, prompts, results |
transcript_path from hook input |
| AI-SDLC audit log |
Pipeline stage events, decisions |
orchestrator/src/audit-extended.ts |
| GitHub Actions logs |
CI results, workflow runs |
gh api |
| Git history |
Commit patterns, file change frequency |
git log |
| Slack messages |
Discussion patterns, issue triggers |
Slack API |
Example Workflow
- After 5 sessions, the system detects: "User always copies CI failure output, pastes to Claude, asks to fix, pushes, repeats"
- System proposes: "Create a
/fix-pr slash command that automatically fetches CI logs and review findings"
- User approves
- System generates
.claude/commands/fix-pr.md with the workflow steps
- Next session, user types
/fix-pr 49 instead of the manual cycle
Prior Art
- GitHub Copilot Workspace — observes edit patterns
- Temporal workflows — detect repeated human-in-the-loop steps
- Process mining (Celonis) — discover workflows from event logs
- Claude Code Insights — already analyzes session patterns (we can build on this)
Complexity
8
Acceptance Criteria
Description
The AI-SDLC framework currently governs AI agent behavior, but it doesn't learn from how humans use those agents. We need a system that observes human-AI interaction patterns, detects repetitive workflows, and proposes deterministic automations that eliminate manual toil.
The key principle: The LLM observes and proposes, but the output is deterministic automation — shell scripts, YAML workflows, skill files. No AI in the runtime loop.
Architecture
Layer 1: Observe — Session Telemetry
transcript_pathin hook input)Layer 2: Detect — Pattern Recognition
Example patterns to detect:
/fix-prcommandLayer 3: Propose — Automation Candidates
Layer 4: Apply — Generate Deterministic Automation
.claude/skills/<name>/SKILL.mdfor interactive workflows.claude/commands/<name>.mdfor slash commands.claude/hooks/<name>.shfor pre/post tool hooks.github/workflows/<name>.ymlfor CI/CD automationsData Sources
transcript_pathfrom hook inputorchestrator/src/audit-extended.tsgh apigit logExample Workflow
/fix-prslash command that automatically fetches CI logs and review findings".claude/commands/fix-pr.mdwith the workflow steps/fix-pr 49instead of the manual cyclePrior Art
Complexity
8
Acceptance Criteria