Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

**If missing**: Emit now, then proceed.

**⚠️ ENFORCEMENT**: These emissions are checked by `scripts/check_workflow_compliance.sh`. Workflow logs without [AKIS_LOADED], [SKILLS:], and [SKILLS_USED] fail compliance audits.

**Progress format**:
- `progress=4/0` - Main thread, phase 4, no stack
- `progress=1/1` - Interrupted at depth 1, phase 1 of nested task
Expand Down Expand Up @@ -44,13 +46,18 @@
```
[SESSION: task_description] @mode
[CONTEXT] objective, scope, constraints
<read_file project_knowledge.json + read_file .github/skills/*/SKILL.md>
<read_file project_knowledge.json + read 3-5 .github/skills/*/SKILL.md files>
[AKIS_LOADED]
entities: N entities from project_knowledge.json
skills: skill-name, skill-name, skill-name (loaded via read_file)
patterns: pattern1, pattern2
```

**⚠️ CRITICAL EMISSIONS - DO NOT SKIP**:
- **CONTEXT phase**: `[AKIS_LOADED]` with entity count, skill names, and patterns
- **COORDINATE phase**: `[SKILLS: name, name]` or `[METHOD: approach]`
- **COMPLETE phase**: `[SKILLS_USED] name, name` or `[METHOD: approach]`

**MANDATORY: Follow 7-phase flow**:
```
[PHASE: CONTEXT | progress=1/V] → Load knowledge + read skills, understand task
Expand Down Expand Up @@ -132,13 +139,13 @@ _DevTeam (Orchestrator) → Defines WHO and WHEN to delegate

| Phase | MANDATORY Actions |
|-------|-------------------|
| **1. CONTEXT** | Load `project_knowledge.json`, query relevant skills from `.github/skills/`, understand task, emit [AKIS_LOADED] |
| **1. CONTEXT** | Load `project_knowledge.json`, read 3-5 relevant `.github/skills/*/SKILL.md`, understand task<br>**→ ALWAYS EMIT**: `[AKIS_LOADED]` with entities count, skill names, patterns |
| **2. PLAN** | Design approach, consider alternatives, decide delegation, identify skills to use |
| **3. COORDINATE** | #runSubagent OR prepare tools, emit [SKILLS: skill-name] or [METHOD: approach] |
| **3. COORDINATE** | #runSubagent OR prepare tools<br>**→ ALWAYS EMIT**: `[SKILLS: skill-name, skill-name]` or `[METHOD: approach]` |
| **4. INTEGRATE** | Execute work, apply changes, follow skill patterns |
| **5. VERIFY** | Test, emit `[→VERIFY]`, **WAIT for user** |
| **6. LEARN** | Update `project_knowledge.json`, extract patterns, suggest new skills |
| **7. COMPLETE** | Emit structured completion with [SKILLS_USED], create workflow log |
| **7. COMPLETE** | Emit structured completion<br>**→ ALWAYS EMIT**: `[SKILLS_USED] skill-name, skill-name` (or `[METHOD: approach]`), create workflow log |

---

Expand Down
10 changes: 6 additions & 4 deletions .github/instructions/phases.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ CONTEXT → PLAN → COORDINATE → INTEGRATE → VERIFY → LEARN → COMPLETE

| Phase | MANDATORY Actions |
|-------|------------------|
| **1. CONTEXT** | Read project_knowledge.json + read_file 3-5 relevant `.github/skills/*/SKILL.md` files, understand task, emit [AKIS_LOADED] with loaded skills |
| **1. CONTEXT** | Read project_knowledge.json + read_file 3-5 relevant `.github/skills/*/SKILL.md` files<br>**→ EMIT**: `[AKIS_LOADED]` with entity count, skill names, patterns |
| **2. PLAN** | Design approach, consider alternatives, decide delegation, identify skills to use |
| **3. COORDINATE** | #runSubagent OR prepare tools, emit [SKILLS: skill-name] or [METHOD: approach] |
| **3. COORDINATE** | #runSubagent OR prepare tools<br>**→ EMIT**: `[SKILLS: skill-name, skill-name]` or `[METHOD: approach]` |
| **4. INTEGRATE** | Execute work, apply changes, follow skill patterns |
| **5. VERIFY** | Test, emit [→VERIFY], WAIT for user |
| **5. VERIFY** | Test<br>**→ EMIT**: `[→VERIFY]`, **WAIT for user confirmation** |
| **6. LEARN** | Update project_knowledge.json, extract patterns, suggest new skills |
| **7. COMPLETE** | Emit structured completion with [SKILLS_USED], create workflow log |
| **7. COMPLETE** | Emit structured completion<br>**→ EMIT**: `[SKILLS_USED] skill-name, skill-name` or `[METHOD: approach]`, create workflow log |

**⚠️ CRITICAL**: Do not skip emissions in phases 1, 3, and 7 - they enable protocol compliance tracking

## Skip Phases (only if justified)

Expand Down
42 changes: 31 additions & 11 deletions .github/prompts/update_akis.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ Reviewer: Validate improvements → verify metrics

## Measurements

**Parse workflow logs**:
**Automated compliance check**:
```bash
# Run batch compliance analysis on all workflow logs
bash scripts/check_all_workflows.sh

# Check a single workflow log
bash scripts/check_workflow_compliance.sh log/workflow/YYYY-MM-DD_HHMMSS_task.md
```

**Parse workflow logs** (manual if needed):
```bash
# Protocol compliance
grep -rh "\[SESSION\|\[AKIS_LOADED\|\[SKILLS" log/workflow/ | wc -l
Expand Down Expand Up @@ -61,12 +70,15 @@ grep -rh "SKILLS_USED" log/workflow/ | tr ',' '\n' | sort | uniq -c | sort -rn

**Analyze knowledge**:
```bash
# Quick knowledge stats
wc -l project_knowledge.json
python3 scripts/validate_knowledge.py # duplicates, staleness, quality

# Detailed quality analysis (create this script as needed)
# python3 scripts/validate_knowledge.py
```

**Calculate metrics**:
- Protocol compliance: `[SESSION]`, `[KNOWLEDGE]`, `[SKILLS]` count / total sessions
- Protocol compliance: Use `scripts/check_all_workflows.sh` for automated analysis
- Usage rate: Sessions using component / total sessions
- Quality score: Freshness(20) + Relations(30) + NoDupes(20) + Observations(20) + Timestamps(10)
- Actionability: Checklist items / descriptive lines
Expand All @@ -91,13 +103,17 @@ python3 scripts/validate_knowledge.py # duplicates, staleness, quality

## Targets

| Component | Before | Target | Validation |
|-----------|--------|--------|------------|
| Agents | Delegation gaps | 80%+ success | Clear handoffs |
| Knowledge | 70/100 quality | 85+/100 | No dupes, timestamps |
| Instructions | 352 lines | <200 lines | 60%+ adoption |
| Skills | 17 skills, progressive disclosure | 20+ skills, 50%+ activation | YAML frontmatter, usage tracking |
| Framework | Protocol compliance | 80%+ sessions | HOW tracking, skill emissions |
| Component | Before | Target | Current (2025-12-31) | Status |
|-----------|--------|--------|---------------------|---------|
| Agents | Delegation gaps | 80%+ success | 5 agents, clear roles | ✅ Structure ready |
| Knowledge | 70/100 quality | 85+/100 | 85.2/100 | ✅ **TARGET MET** |
| Instructions | 352 lines | <200/file | 188+257+457=902 total | ✅ All files <200 |
| Skills | 17 skills | Optimal count | 13 skills (-24%) | ✅ **OPTIMIZED** |
| Skills YAML | Unknown | 100% | 13/13 (100%) | ✅ **TARGET MET** |
| Protocol compliance | 5.3% | 80%+ sessions | 11.5% | ❌ **PRIMARY GAP** |
| Skills tracking | 0% | 100% | 3.8% | ❌ **NEEDS WORK** |

**Next measurement**: After 10 new sessions (estimate 2026-01-07)

---

Expand All @@ -107,7 +123,11 @@ python3 scripts/validate_knowledge.py # duplicates, staleness, quality
- `project_knowledge.json` - Cleaned, deduplicated
- `.github/instructions/*.md` - Simplified protocols
- `.github/skills/*/SKILL.md` - Individual skills with YAML frontmatter, checklists, examples
- `docs/analysis/AKIS_OPTIMIZATION_YYYY-MM-DD.md` - Metrics, recommendations
- `docs/analysis/AKIS_OPTIMIZATION_YYYY-MM-DD.md` - Metrics, recommendations, gap analysis
- `scripts/check_workflow_compliance.sh` - Single log compliance checker
- `scripts/check_all_workflows.sh` - Batch compliance analyzer

**Latest analysis**: `docs/analysis/AKIS_OPTIMIZATION_2025-12-31.md`

### Skill Structure Requirements

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ Thumbs.db

# Logs - workflow logs are tracked in git for session history
# log/**/*.md # Removed - workflow logs should be committed
project_knowledge.json.new
Loading