Skip to content
Closed
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
14 changes: 11 additions & 3 deletions .claude/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ project_knowledge.json → Project entities, codegraph, relations
**Protocol**:
| Event | Action |
|-------|--------|
| Session start | Load knowledge, query relevant entities |
| Session start | Load knowledge, **EMIT** [KNOWLEDGE: loaded \| entities=N \| sources=M] |
| Decision made | Document rationale, alternatives |
| Bug fixed | Add pattern to knowledge |
| Session end | Update knowledge, create handover |
Expand All @@ -166,7 +166,10 @@ CONTEXT → PLAN → COORDINATE → INTEGRATE → VERIFY → LEARN → COMPLETE
**Emissions**:
```
[SESSION: role=Lead | task=<desc> | phase=CONTEXT]
[SKILLS: loaded=N | available: #1,#2,#3...]
[KNOWLEDGE: loaded | entities=N | sources=M]
[PHASE: PLAN | progress=2/7 | next=COORDINATE]
[SKILL: #N Name | applied] → when using a skill
[TASK: <desc>]
├── [x] CONTEXT
├── [ ] DELEGATE→Agent ← current
Expand Down Expand Up @@ -311,7 +314,7 @@ services:

**Trigger**: Session completion (significant work)

**CRITICAL**: Workflow logs MUST include Decision Diagram with all [DECISION:], [ATTEMPT:], [SUBAGENT:] markers.
**CRITICAL**: Workflow logs MUST include Decision Diagram with all [DECISION:], [ATTEMPT:], [SUBAGENT:], [SKILL:] markers.

**Pattern**:
```bash
Expand All @@ -323,10 +326,14 @@ log_file="log/workflow/${timestamp}_${task_slug}.md"
**Decision Diagram** (required in every log):
```
[SESSION START: <Task>]
├─[SKILLS: loaded=N]
├─[KNOWLEDGE: loaded | entities=N]
|
└─[DECISION: <question>?]
├─ Option A: <desc> → Rejected (<reason>)
└─ ✓ Option C: <desc> → CHOSEN (<rationale>)
|
├─[SKILL: #N Name | applied] → <what/why>
|
├─[SUBAGENT: Name] <task>
| ├─[ATTEMPT #1] <action> → ✗ failed
Expand Down Expand Up @@ -356,7 +363,8 @@ log_file="log/workflow/${timestamp}_${task_slug}.md"
```

**Checklist Before [COMPLETE]**:
- [ ] Decision Diagram shows all [DECISION:], [ATTEMPT:], [SUBAGENT:]
- [ ] Decision Diagram shows all [DECISION:], [ATTEMPT:], [SUBAGENT:], [SKILL:]
- [ ] Skills/knowledge loading documented at start
- [ ] Rejected alternatives documented
- [ ] All ✓/✗ outcomes marked
- [ ] Workflow log file created
Expand Down
10 changes: 7 additions & 3 deletions .github/agents/_DevTeam.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Coordinates specialists, maintains task control, integrates results.
```
[SESSION: role=Lead | task=<desc> | phase=CONTEXT]
[PHASE: CONTEXT | progress=1/7]
[SKILLS: loaded=N | available: #1,#2,#3...]
[KNOWLEDGE: loaded | entities=N | sources=M]
```
Load skills → project knowledge → global knowledge BEFORE proceeding.
Load skills → project knowledge → global knowledge BEFORE proceeding. **EMIT** verification.

## Hierarchy
```
Expand All @@ -26,8 +28,10 @@ _DevTeam (Orchestrator)
## Session Protocol
```
[SESSION: role=Lead | task=<desc> | phase=CONTEXT]
[SKILLS: loaded=N | available: #1,#2,#3...]
[KNOWLEDGE: loaded | entities=N | sources=M]
```
Load: `project_knowledge.json` → `.github/global_knowledge.json` → detect project type
Load: `project_knowledge.json` → `.github/global_knowledge.json` → detect project type → **EMIT** confirmations

## Phase Flow
```
Expand Down Expand Up @@ -121,7 +125,7 @@ Summary | Decision & Execution Flow | Agent Interactions | Files | Quality Gates
## Emissions (for Decision Tree)
```
[DECISION: question] → chosen_path
[SKILL: #N Name] → result
[SKILL: #N Name | applied] → what/why
[SUBAGENT: Name] task
[ATTEMPT #N] action → ✓/✗ result
[LOOP: desc] → outcome
Expand Down
33 changes: 27 additions & 6 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,33 @@ _DevTeam (Orchestrator)
**Required emissions throughout session**:
1. `[SESSION: ...]` ← FIRST ACTION, before any tool use
2. `[PHASE: CONTEXT | progress=1/7]` ← SECOND ACTION, immediately after SESSION
3. `[PHASE: PLAN | progress=2/7]` when designing solution
4. `[DECISION: ?]` for EVERY choice between alternatives
5. `[ATTEMPT #N]` for EVERY implementation iteration
6. `[SUBAGENT: Name]` for EVERY delegation (#runSubagent)
7. Track ALL phase transitions
3. `[SKILLS: loaded=N | available: #1,#2,#3...]` ← THIRD ACTION, list loaded skills
4. `[KNOWLEDGE: loaded | entities=N | sources=M]` ← FOURTH ACTION, confirm knowledge loaded
5. `[PHASE: PLAN | progress=2/7]` when designing solution
6. `[DECISION: ?]` for EVERY choice between alternatives
7. `[SKILL: #N Name | applied]` when USING a skill from loaded set
8. `[ATTEMPT #N]` for EVERY implementation iteration
9. `[SUBAGENT: Name]` for EVERY delegation (#runSubagent)
10. Track ALL phase transitions

**ENFORCEMENT**: These are REQUIRED, not optional. Protocol compliance tracked in workflow logs.
**VIOLATION CHECK**: Before any file edit, verify [SESSION:] and [PHASE: CONTEXT] were emitted.
**VIOLATION CHECK**: Before any file edit, verify [SESSION:], [PHASE: CONTEXT], [SKILLS:], and [KNOWLEDGE:] were emitted.

**Knowledge Loading Protocol**:
```
Load order: `.claude/skills.md` → `project_knowledge.json` → `.github/global_knowledge.json`

[SKILLS: loaded=14 | available: #1-Code Standards, #2-Error Handling, #3-Security, #4-Testing, #5-Git & Deploy, #6-Knowledge, #7-Orchestration, #8-Handover, #9-Logging, #10-API Patterns, #11-UI Patterns, #12-Infrastructure, #13-Workflow Logs, #14-Context Switching]
[KNOWLEDGE: loaded | entities=50 | sources=2 (project_knowledge.json, global_knowledge.json)]
```

**Skill Usage Tracking**:
When applying a skill during work, emit:
```
[SKILL: #3 Security | applied] → Validating input sanitization
[SKILL: #10 API Patterns | applied] → Using FastAPI response model pattern
```

## Delegation

**Use #runSubagent for specialist work**:
Expand Down Expand Up @@ -150,13 +166,18 @@ Summary | Decision Diagram | Agent Interactions | Files | Quality Gates | Learni
```
[SESSION: role=Lead | task=<desc> | phase=CONTEXT]
[PHASE: CONTEXT | progress=1/7]
[SKILLS: loaded=N | available: #1,#2,#3...]
[KNOWLEDGE: loaded | entities=N | sources=M]
```

**During task execution**:
- [ ] Emit `[SESSION:]` at start ← **FIRST ACTION**
- [ ] Emit `[PHASE: CONTEXT | progress=1/7]` ← **SECOND ACTION**
- [ ] Emit `[SKILLS: loaded=N | available: ...]` ← **THIRD ACTION**
- [ ] Emit `[KNOWLEDGE: loaded | entities=N | sources=M]` ← **FOURTH ACTION**
- [ ] Emit `[PHASE: PLAN | progress=2/7]` when designing
- [ ] Emit `[DECISION: ?]` for every choice
- [ ] Emit `[SKILL: #N Name | applied]` when using a skill
- [ ] Emit `[ATTEMPT #N]` for every implementation try
- [ ] Use `#runSubagent` for specialist work → Emit `[SUBAGENT: Name]`
- [ ] Emit `[PHASE: INTEGRATE | progress=4/7]`
Expand Down
11 changes: 11 additions & 0 deletions .github/instructions/protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ applyTo: '**'
## Session
```
[SESSION: role=Lead|Architect|Developer|Reviewer|Researcher | task=<desc> | phase=CONTEXT]
[SKILLS: loaded=N | available: #1,#2,#3...]
[KNOWLEDGE: loaded | entities=N | sources=M]
```

**CRITICAL**: Load and verify knowledge BEFORE proceeding with any work.

## Delegation
```
[DELEGATE: agent=<specialist> | task=<desc>]
Expand Down Expand Up @@ -49,6 +53,13 @@ Artifacts: [files] | Learnings: [patterns]
[PHASE: CONTEXT|PLAN|COORDINATE|INTEGRATE|VERIFY|LEARN|COMPLETE | progress=N/7 | next=<phase>]
```

## Skill Usage
```
[SKILL: #N Name | applied] → action/context
```
**Purpose**: Transparency - shows which skills are being applied when.
**Example**: `[SKILL: #3 Security | applied] → Validating input sanitization`

## Knowledge
```
[KNOWLEDGE: added=N | updated=M | type=project|global]
Expand Down
Loading