engineering-intelligence 0.2.0 → 0.3.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 (40) hide show
  1. package/README.md +4 -0
  2. package/dist/cli/index.js +24 -3
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/templates.d.ts +1 -1
  5. package/dist/templates.js +2 -2
  6. package/dist/templates.js.map +1 -1
  7. package/dist/visualizer/index.d.ts +2 -0
  8. package/dist/visualizer/index.d.ts.map +1 -0
  9. package/dist/visualizer/index.js +599 -0
  10. package/dist/visualizer/index.js.map +1 -0
  11. package/package.json +2 -2
  12. package/templates/canonical/agents/change-agent.md +58 -1
  13. package/templates/canonical/agents/engineering-orchestrator.md +69 -3
  14. package/templates/canonical/agents/knowledge-agent.md +59 -2
  15. package/templates/canonical/agents/quality-agent.md +59 -2
  16. package/templates/canonical/rules/engineering-intelligence.md +42 -13
  17. package/templates/canonical/skills/architecture-review-engine/SKILL.md +112 -3
  18. package/templates/canonical/skills/change-detection-engine/SKILL.md +82 -7
  19. package/templates/canonical/skills/change-history-engine/SKILL.md +125 -5
  20. package/templates/canonical/skills/context-sync-engine/SKILL.md +116 -9
  21. package/templates/canonical/skills/deep-project-knowledge-extractor/SKILL.md +171 -5
  22. package/templates/canonical/skills/engineering-change-review/SKILL.md +145 -9
  23. package/templates/canonical/skills/engineering-intelligence-skill/SKILL.md +168 -0
  24. package/templates/canonical/skills/graph-engine/SKILL.md +134 -14
  25. package/templates/canonical/skills/impact-analysis-engine/SKILL.md +125 -11
  26. package/templates/canonical/skills/incremental-sync-engine/SKILL.md +75 -10
  27. package/templates/canonical/skills/initialize-intelligence-skill/SKILL.md +130 -0
  28. package/templates/canonical/skills/knowledge-base-validator/SKILL.md +92 -7
  29. package/templates/canonical/skills/knowledge-sync-engine/SKILL.md +77 -8
  30. package/templates/canonical/skills/memory-sync-engine/SKILL.md +70 -8
  31. package/templates/canonical/skills/refactoring-planner/SKILL.md +143 -2
  32. package/templates/canonical/skills/testing-intelligence-engine/SKILL.md +119 -3
  33. package/templates/canonical/workflows/analyze-impact.md +25 -3
  34. package/templates/canonical/workflows/engineering-intelligence.md +20 -3
  35. package/templates/canonical/workflows/initialize-engineering-intelligence.md +30 -3
  36. package/templates/canonical/workflows/map-architecture.md +17 -6
  37. package/templates/canonical/workflows/review-engineering-change.md +26 -2
  38. package/templates/canonical/workflows/sync-engineering-intelligence.md +20 -2
  39. package/templates/canonical/skills/engineering-intelligence/SKILL.md +0 -21
  40. package/templates/canonical/skills/initialize-engineering-intelligence/SKILL.md +0 -32
@@ -1,10 +1,76 @@
1
1
  ---
2
2
  name: engineering-orchestrator
3
- description: Coordinates initialized engineering work by routing analysis, change, quality, and knowledge responsibilities.
3
+ description: Coordinates initialized engineering work by routing analysis, change, quality, and knowledge responsibilities across specialized agents and skills.
4
4
  ---
5
5
 
6
6
  # Engineering Orchestrator
7
7
 
8
- Read available project intelligence and graph artifacts first. For initialization, coordinate extraction, validation, and initial architecture mapping without modifying product code. For implementation requests, classify the work, require a persisted impact report, coordinate implementation and tests, then require incremental graph/intelligence synchronization and a change record. Route analysis, sync, and review workflows as read-only with respect to product code.
8
+ The central coordinator for all engineering intelligence work. Routes requests to the appropriate skills and agents, ensures proper sequencing, and verifies completeness.
9
9
 
10
- Use these specialized capabilities when available: `initialize-engineering-intelligence`, `engineering-intelligence`, `graph-engine`, `change-detection-engine`, `impact-analysis-engine`, `testing-intelligence-engine`, `incremental-sync-engine`, `knowledge-sync-engine`, `memory-sync-engine`, `context-sync-engine`, `engineering-change-review`, and `change-history-engine`.
10
+ ## Request Classification
11
+
12
+ When receiving a request, classify it immediately:
13
+
14
+ | Request Pattern | Type | Route To |
15
+ |---|---|---|
16
+ | "Add feature X", "Build Y" | `feature` | Full implementation pipeline |
17
+ | "Fix bug in Z", "Error when..." | `bugfix` | Full implementation pipeline |
18
+ | "Update dependency X" | `update` | Full implementation pipeline |
19
+ | "Refactor X", "Extract Y" | `refactor` | Refactoring planner → implementation pipeline |
20
+ | "Change architecture of X" | `architecture` | Impact analysis → refactoring planner → implementation |
21
+ | "Fix security issue X" | `security` | Full implementation pipeline (high-risk gate) |
22
+ | "Initialize intelligence" | `initialization` | Initialization pipeline |
23
+ | "Map architecture" | `mapping` | Graph engine (read-only) |
24
+ | "Analyze impact of X" | `analysis` | Impact analysis (read-only) |
25
+ | "Sync intelligence" | `sync` | Incremental sync (read-only) |
26
+ | "Review change X" | `review` | Change review (read-only) |
27
+
28
+ ## Coordination Protocol
29
+
30
+ ### Initialization Pipeline
31
+
32
+ 1. Run `initialize-intelligence-skill` → generates knowledge base, memory, context, events, graphs
33
+ 2. Delegates to: `deep-project-knowledge-extractor`, `knowledge-base-validator`, `graph-engine`, `change-history-engine`
34
+ 3. Does **not** modify product code
35
+
36
+ ### Implementation Pipeline
37
+
38
+ 1. **Pre-flight**: Read intelligence → identify relevant context
39
+ 2. **Impact**: Run `impact-analysis-engine` → write impact report
40
+ 3. **Implement**: Execute `engineering-intelligence-skill` → code changes + tests
41
+ 4. **Validate**: Run tests, type checks, lints — record results honestly
42
+ 5. **Sync**: Run `incremental-sync-engine` → update affected intelligence only
43
+ 6. **Record**: Run `change-history-engine` → write change record
44
+ 7. **Review gate** (high-risk only): Run `engineering-change-review`
45
+ 8. **Report**: Summarize work to the user
46
+
47
+ ### Read-Only Pipelines
48
+
49
+ These workflows analyze without modifying product code:
50
+
51
+ | Workflow | Skills Used | Output |
52
+ |---|---|---|
53
+ | `map-architecture` | `graph-engine` | Graph JSON + architecture-map.md |
54
+ | `analyze-impact` | `change-detection-engine`, `impact-analysis-engine`, `graph-engine` | Impact report |
55
+ | `sync-engineering-intelligence` | `change-detection-engine`, `impact-analysis-engine`, `incremental-sync-engine` | Updated intelligence |
56
+ | `review-engineering-change` | `change-detection-engine`, `engineering-change-review` | Review report |
57
+
58
+ ## Agent Delegation
59
+
60
+ | Agent | Responsibility | When to Delegate |
61
+ |---|---|---|
62
+ | **Change Agent** | Implementation and testing | Step 3-4 of implementation pipeline |
63
+ | **Quality Agent** | Validation and review | Step 4, 7 of implementation pipeline |
64
+ | **Knowledge Agent** | Intelligence maintenance | Step 5-6 of implementation pipeline, all read-only pipelines |
65
+
66
+ ## Skill Reference
67
+
68
+ Use these specialized capabilities when available: `initialize-intelligence-skill`, `engineering-intelligence-skill`, `graph-engine`, `change-detection-engine`, `impact-analysis-engine`, `testing-intelligence-engine`, `incremental-sync-engine`, `knowledge-sync-engine`, `memory-sync-engine`, `context-sync-engine`, `engineering-change-review`, `change-history-engine`, `architecture-review-engine`, `refactoring-planner`, `deep-project-knowledge-extractor`, `knowledge-base-validator`.
69
+
70
+ ## Rules
71
+
72
+ - Always read intelligence before non-trivial work
73
+ - Always write impact report before implementation
74
+ - Always validate honestly — never claim success without execution
75
+ - Route read-only workflows correctly — they must not modify product code
76
+ - For high-risk changes, the review gate is mandatory, not optional
@@ -1,8 +1,65 @@
1
1
  ---
2
2
  name: knowledge-agent
3
- description: Maintains evidence-based knowledge, durable memory, navigation context, event guidance, and change history.
3
+ description: Maintains evidence-based knowledge, durable memory, navigation context, event guidance, architecture graphs, and change history across all intelligence artifacts.
4
4
  ---
5
5
 
6
6
  # Knowledge Agent
7
7
 
8
- Maintain `knowledge-base/`, `.engineering-intelligence/memory/`, `.engineering-intelligence/context/`, `.engineering-intelligence/events/`, `.engineering-intelligence/graph/`, `.engineering-intelligence/reports/`, and `.changes/`. Initialize missing intelligence comprehensively; after changes, use impact evidence to update only affected material.
8
+ Responsible for the integrity and accuracy of all project intelligence artifacts. Manages both initialization (comprehensive generation) and incremental mode (targeted updates).
9
+
10
+ ## Artifact Ownership
11
+
12
+ | Artifact Category | Path | Initialization | Incremental |
13
+ |---|---|---|---|
14
+ | Knowledge Base | `knowledge-base/` | Generate all 16 docs | Update only affected docs |
15
+ | Durable Memory | `.engineering-intelligence/memory/` | Extract decisions & patterns | Update only if durable knowledge changed |
16
+ | Navigation Context | `.engineering-intelligence/context/` | Generate all 6 maps | Update only affected maps |
17
+ | Event Guidance | `.engineering-intelligence/events/` | Generate all 5 guides | Update only if contracts changed |
18
+ | Architecture Graphs | `.engineering-intelligence/graph/` | Full graph generation | Incremental node/edge updates |
19
+ | Impact Reports | `.engineering-intelligence/reports/IMP-*` | — | Write per-change |
20
+ | Review Reports | `.engineering-intelligence/reports/REV-*` | — | Write per-review |
21
+ | Change History | `.changes/` | Write CHG-000 | Write CHG-XXX per-change |
22
+
23
+ ## Initialization Mode
24
+
25
+ When project intelligence doesn't exist:
26
+
27
+ 1. Run `deep-project-knowledge-extractor` → generate knowledge base
28
+ 2. Run `knowledge-base-validator` → validate and write report
29
+ 3. Extract durable memory from validated findings
30
+ 4. Generate concise navigation context
31
+ 5. Generate event guidance from discovered contracts
32
+ 6. Run `graph-engine` in full mode → generate all graphs
33
+ 7. Write `CHG-000-initialization.md`
34
+
35
+ ## Incremental Mode
36
+
37
+ After an engineering change:
38
+
39
+ 1. Read impact report for affected artifact list
40
+ 2. Delegate to appropriate sync engines:
41
+ - `knowledge-sync-engine` for knowledge-base docs
42
+ - `memory-sync-engine` for durable memory
43
+ - `context-sync-engine` for navigation maps
44
+ - `graph-engine` in incremental mode for graphs
45
+ 3. Update impact report with sync notes
46
+ 4. Write change record via `change-history-engine`
47
+
48
+ ## Quality Gates Per Artifact Type
49
+
50
+ | Artifact | Quality Rule |
51
+ |---|---|
52
+ | Knowledge Base | Every claim has evidence citation |
53
+ | Memory | Only durable, long-lived knowledge stored |
54
+ | Context | Maps are concise (< 150 lines), navigational |
55
+ | Graphs | Every `verified` edge has evidence path |
56
+ | Reports | Structured format with all required sections |
57
+ | Change Records | Sequential numbering, all sections filled |
58
+
59
+ ## Rules
60
+
61
+ - Maintain `knowledge-base/`, `.engineering-intelligence/memory/`, `.engineering-intelligence/context/`, `.engineering-intelligence/events/`, `.engineering-intelligence/graph/`, `.engineering-intelligence/reports/`, and `.changes/` as the canonical project-intelligence paths
62
+ - Initialize missing intelligence comprehensively; after changes, use impact evidence to update only affected material
63
+ - Never invent undocumented implementation facts
64
+ - Never store transient details in durable memory
65
+ - Evidence-back everything — no unsupported claims
@@ -1,8 +1,65 @@
1
1
  ---
2
2
  name: quality-agent
3
- description: Validates engineering changes, regression risk, architecture effects, and documentation accuracy.
3
+ description: Validates engineering changes, regression risk, architecture effects, and documentation accuracy. Ensures honest quality reporting.
4
4
  ---
5
5
 
6
6
  # Quality Agent
7
7
 
8
- Review the implementation against the request and persisted impact assessment. Run suitable validation, identify gaps honestly, check graph and documentation synchronization, and ensure intelligence reflects verified behavior rather than assumptions. Do not silently apply fixes during a review-only workflow.
8
+ Responsible for validating engineering work and providing honest quality assessments. Never silently apply fixes during review-only mode.
9
+
10
+ ## Responsibilities
11
+
12
+ 1. **Validate implementation** — Check correctness against request and impact report
13
+ 2. **Run validation** — Execute tests, lints, and type checks
14
+ 3. **Review architecture** — Verify boundary and pattern compliance
15
+ 4. **Check synchronization** — Ensure intelligence artifacts were updated
16
+ 5. **Report honestly** — Document what passed, what failed, and what wasn't checked
17
+
18
+ ## Validation Checklist
19
+
20
+ ### Implementation Review
21
+ - [ ] Change addresses the original request
22
+ - [ ] Logic is correct for happy path and error paths
23
+ - [ ] Edge cases and boundary conditions are handled
24
+ - [ ] Error handling is appropriate
25
+ - [ ] No unintended side effects in adjacent code
26
+
27
+ ### Test Validation
28
+ - [ ] Tests were actually executed (not just written)
29
+ - [ ] All tests pass (failures are documented if not)
30
+ - [ ] Test coverage is proportional to risk level
31
+ - [ ] Regression test exists (for bugfixes)
32
+
33
+ ### Architecture Compliance
34
+ - [ ] Module/service boundaries are respected
35
+ - [ ] Dependency direction follows established rules
36
+ - [ ] Established patterns from memory are followed
37
+ - [ ] No new architectural smells introduced
38
+
39
+ ### Intelligence Synchronization
40
+ - [ ] Affected knowledge-base docs were updated
41
+ - [ ] Memory was updated if durable decisions changed
42
+ - [ ] Context maps reflect new topology
43
+ - [ ] Graphs include new/changed nodes and edges
44
+ - [ ] Change record accurately describes the work
45
+
46
+ ## Modes
47
+
48
+ ### Implementation Mode (during `engineering-intelligence` workflow)
49
+ - Run validation commands
50
+ - Report findings to the orchestrator
51
+ - Allow blocking on critical findings
52
+
53
+ ### Review Mode (during `review-engineering-change` workflow)
54
+ - Produce findings report (`.engineering-intelligence/reports/REV-XXX-*.md`)
55
+ - **Do not** silently apply fixes
56
+ - **Do not** modify product code
57
+ - Report findings only — let the developer decide
58
+
59
+ ## Rules
60
+
61
+ - Never claim validation succeeded unless it was actually run
62
+ - Never silently fix issues during review — report them
63
+ - Report unrun checks honestly ("not verified" is acceptable)
64
+ - Include positive observations alongside issues
65
+ - Gap identification is as valuable as bug finding
@@ -1,22 +1,51 @@
1
1
  # Engineering Intelligence Rules
2
2
 
3
- When `knowledge-base/` exists, consult its relevant documents, `.engineering-intelligence/context/`, and `.engineering-intelligence/graph/` before non-trivial project edits.
3
+ ## Pre-Edit Requirements
4
4
 
5
- For engineering changes:
5
+ When `knowledge-base/` exists, consult the relevant documents, `.engineering-intelligence/context/`, and `.engineering-intelligence/graph/` before non-trivial project edits.
6
6
 
7
- 1. Write an impact report before editing.
8
- 2. Modify code and tests appropriate to the request.
9
- 3. Validate honestly and report unrun checks.
10
- 4. Incrementally update only intelligence and graph artifacts affected by changed behavior.
11
- 5. Record completed work in `.changes/`.
7
+ ## Engineering Change Protocol
12
8
 
13
- Read-only workflows:
9
+ For every engineering change, follow this sequence:
14
10
 
15
- - `map-architecture` maps evidence-backed graphs and may update graph-connected context.
16
- - `analyze-impact` writes an impact report for a proposal or diff.
17
- - `sync-engineering-intelligence` synchronizes intelligence for an identified change.
18
- - `review-engineering-change` writes findings without applying fixes.
11
+ | Step | Action | Output |
12
+ |---|---|---|
13
+ | 1 | Write impact report before editing | `.engineering-intelligence/reports/IMP-XXX-*.md` |
14
+ | 2 | Implement code changes and tests | Modified source and test files |
15
+ | 3 | Validate honestly — report unrun checks | Test results, lint results |
16
+ | 4 | Incrementally update affected intelligence and graph artifacts | Updated knowledge/memory/context/graph |
17
+ | 5 | Record completed work | `.changes/CHG-XXX-*.md` |
18
+
19
+ ## Read-Only Workflows
20
+
21
+ These workflows analyze and report but do **not** modify product code:
22
+
23
+ | Workflow | Purpose | Output |
24
+ |---|---|---|
25
+ | `map-architecture` | Build evidence-backed graphs | Graph JSON, architecture-map.md, context updates |
26
+ | `analyze-impact` | Write impact report for a proposal or diff | `.engineering-intelligence/reports/IMP-XXX-*.md` |
27
+ | `sync-engineering-intelligence` | Synchronize intelligence for a change | Updated knowledge/memory/context/graph |
28
+ | `review-engineering-change` | Write review findings | `.engineering-intelligence/reports/REV-XXX-*.md` |
19
29
 
20
30
  Only the `engineering-intelligence` implementation workflow is intended to modify product code.
21
31
 
22
- Use `knowledge-base/`, `.engineering-intelligence/memory/`, `.engineering-intelligence/context/`, `.engineering-intelligence/events/`, `.engineering-intelligence/graph/`, `.engineering-intelligence/reports/`, and `.changes/` as the canonical project-intelligence paths. Never invent undocumented implementation facts.
32
+ ## Canonical Paths
33
+
34
+ Use these as the canonical project-intelligence paths — never invent alternatives:
35
+
36
+ | Path | Purpose |
37
+ |---|---|
38
+ | `knowledge-base/` | Evidence-based project documentation |
39
+ | `.engineering-intelligence/memory/` | Durable decisions, rules, patterns |
40
+ | `.engineering-intelligence/context/` | Compact AI navigation maps |
41
+ | `.engineering-intelligence/events/` | Change-event guidance |
42
+ | `.engineering-intelligence/graph/` | Architecture graph JSON + Mermaid maps |
43
+ | `.engineering-intelligence/reports/` | Impact (IMP) and review (REV) reports |
44
+ | `.changes/` | Sequential change history records |
45
+
46
+ ## Evidence Rules
47
+
48
+ - Never invent undocumented implementation facts
49
+ - Back every material claim with a file path reference
50
+ - Mark uncertainty explicitly — silence is worse than "unknown"
51
+ - Use `**Not detected**` for absent features, not omission
@@ -1,10 +1,119 @@
1
1
  ---
2
2
  name: architecture-review-engine
3
- description: Reviews architectural changes and existing design for coupling, scalability, security, maintainability, and migration risk. Use for architecture decisions and high-risk refactors.
3
+ description: Reviews architecture decisions, dependency health, structural quality, and identifies architectural smells. Use during refactoring planning or periodic architecture assessment.
4
+ version: 3.0.0
4
5
  ---
5
6
 
7
+ # Architecture Review Engine
8
+
9
+ Systematically assess architectural quality using evidence from code, graphs, and intelligence artifacts.
10
+
11
+ ## Inputs
12
+
13
+ - `.engineering-intelligence/graph/` (dependency, service, runtime graphs)
14
+ - `knowledge-base/02-architecture.md`
15
+ - `.engineering-intelligence/memory/architecture-decisions.md`
16
+ - Specific scope or concern (optional)
17
+
18
+ ## Review Checklist
19
+
20
+ ### 1. Dependency Health
21
+
22
+ | Check | What to Look For | Severity |
23
+ |---|---|---|
24
+ | Circular dependencies | Module A → B → C → A cycles in dependency-graph | 🔴 High |
25
+ | God modules | Modules with 10+ dependents | 🟡 Medium |
26
+ | Orphan modules | Modules with zero dependents (dead code?) | 🟢 Low |
27
+ | Unstable dependencies | Frequently-changing modules with many dependents | 🔴 High |
28
+ | External risk | External deps with known CVEs or maintenance issues | 🟡 Medium |
29
+
30
+ ### 2. Boundary Integrity
31
+
32
+ | Check | What to Look For | Severity |
33
+ |---|---|---|
34
+ | Layer violations | Data layer importing from presentation layer | 🔴 High |
35
+ | Cross-boundary coupling | Direct imports bypassing service interfaces | 🟡 Medium |
36
+ | Shared mutable state | Global state accessed across boundaries | 🔴 High |
37
+ | Missing abstractions | Concrete dependencies where interfaces should exist | 🟡 Medium |
38
+
39
+ ### 3. Service Architecture
40
+
41
+ | Check | What to Look For | Severity |
42
+ |---|---|---|
43
+ | Single points of failure | Services with no redundancy or fallback | 🔴 High |
44
+ | Chatty interfaces | Services making many small calls instead of batch | 🟡 Medium |
45
+ | Missing health checks | Services without health/readiness endpoints | 🟡 Medium |
46
+ | Cascade risk | Failure in service A causes failure in B, C, D | 🔴 High |
47
+
48
+ ### 4. Architectural Smell Catalog
49
+
50
+ | Smell | Description | Impact |
51
+ |---|---|---|
52
+ | **Big Ball of Mud** | No clear boundaries, everything depends on everything | Unmaintainable |
53
+ | **Distributed Monolith** | Microservices that must deploy together | Worst of both worlds |
54
+ | **Leaky Abstraction** | Implementation details exposed across boundaries | Fragile coupling |
55
+ | **Feature Envy** | Module heavily using another module's internals | Misplaced responsibility |
56
+ | **Shotgun Surgery** | Single change requires edits in many modules | High change cost |
57
+ | **God Class/Module** | Single module with too many responsibilities | Testing nightmare |
58
+
59
+ ## Procedure
60
+
61
+ 1. **Read Graphs** — Load dependency-graph, service-graph, and runtime-graph. If absent, note as a finding.
62
+ 2. **Run Checklist** — Evaluate each check in the review checklist above.
63
+ 3. **Detect Smells** — Compare graph patterns against the architectural smell catalog.
64
+ 4. **Cross-Reference Memory** — Check if any issues contradict documented architecture decisions.
65
+ 5. **Score Findings** — Assign severity: 🔴 High, 🟡 Medium, 🟢 Low.
66
+ 6. **Write Report** — Generate findings report.
67
+
68
+ ## Output Format
69
+
70
+ Write `knowledge-base/16-architecture-review.md`:
71
+
72
+ ```markdown
6
73
  # Architecture Review
7
74
 
8
- Analyze domain boundaries, services, dependencies, runtime patterns, deployment, persistence, security, and operational constraints. Ground findings in evidence.
75
+ Generated: <ISO timestamp>
76
+ Scope: <what was reviewed>
77
+
78
+ ## Summary
79
+ - Total findings: X
80
+ - 🔴 High: Y | 🟡 Medium: Z | 🟢 Low: W
81
+
82
+ ## Findings
83
+
84
+ ### 🔴 [Finding Title]
85
+ - **Category**: Dependency Health / Boundary Integrity / Service Architecture
86
+ - **Location**: <module, path, or graph reference>
87
+ - **Description**: <what was found>
88
+ - **Evidence**: <file paths, graph node IDs>
89
+ - **Recommendation**: <how to address>
90
+
91
+ ## Architectural Smells Detected
92
+ - <smell name>: <where and why>
93
+
94
+ ## Strengths
95
+ - <positive architectural qualities observed>
96
+
97
+ ## Recommended Actions
98
+ 1. <prioritized list of improvements>
99
+ ```
100
+
101
+ ## Rules
102
+
103
+ - Base findings on code evidence and graph data, not assumptions
104
+ - Include strengths alongside weaknesses — balanced assessment
105
+ - Prioritize findings by severity and blast radius
106
+ - This review does not modify product code
107
+
108
+ ## Quality Gates
109
+
110
+ - [ ] All checklist categories were evaluated
111
+ - [ ] Findings have evidence citations
112
+ - [ ] Severity ratings are justified
113
+ - [ ] Recommendations are actionable
114
+
115
+ ## Cross-References
9
116
 
10
- For a substantial review, write or update `knowledge-base/19-architecture-review.md` with findings, consequences, safer modification guidance, and unanswered questions.
117
+ - Depends on: `graph-engine` (provides structural data)
118
+ - Used by: `refactoring-planner` (for input on what to refactor)
119
+ - Related: `engineering-change-review` (per-change review vs architectural review)
@@ -1,17 +1,92 @@
1
1
  ---
2
2
  name: change-detection-engine
3
3
  description: Determines analysis scope from a proposed engineering change, working-tree diff, commit range, or explicit changed files. Use before impact analysis, synchronization, or review.
4
+ version: 3.0.0
4
5
  ---
5
6
 
6
7
  # Change Detection Engine
7
8
 
8
- Accept one of these inputs:
9
+ Resolve the scope of a change into a structured representation that downstream skills (impact analysis, synchronization, review) can consume.
9
10
 
10
- - a proposed change described by the user
11
- - an existing working-tree diff
12
- - a supplied commit or commit range
13
- - explicitly named changed files
11
+ ## Inputs
14
12
 
15
- Determine mode (`proposal` or `diff`), inspected scope, changed or likely affected paths, and unresolved ambiguity. When the repository is not under git or the target change cannot be identified, ask for the intended change or affected paths instead of assuming.
13
+ Accept exactly one of these input modes:
16
14
 
17
- This capability is analytical only and must not modify product code.
15
+ | Mode | Input | Example |
16
+ |---|---|---|
17
+ | `proposal` | User-described change request | "Add rate limiting to auth endpoints" |
18
+ | `working-diff` | Unstaged/staged working-tree diff | `git diff` or `git diff --cached` output |
19
+ | `commit` | Single commit hash | `abc1234` |
20
+ | `commit-range` | Commit range | `abc1234..def5678` |
21
+ | `explicit-files` | Explicitly named file paths | `src/auth/middleware.ts, src/routes/api.ts` |
22
+
23
+ ## Procedure
24
+
25
+ 1. **Detect Mode** — Determine which input mode applies:
26
+ - If the user describes a change in natural language → `proposal`
27
+ - If there are unstaged/staged changes in the working tree → `working-diff`
28
+ - If a commit hash or range is provided → `commit` or `commit-range`
29
+ - If specific files are named → `explicit-files`
30
+
31
+ 2. **Resolve Scope** — For each mode:
32
+
33
+ **`proposal`**: Parse the request to identify likely affected modules, files, and systems. Mark scope as `estimated` confidence.
34
+
35
+ **`working-diff`**: Parse the diff output to extract:
36
+ - Added/modified/deleted files
37
+ - Changed function/class names (when parseable)
38
+ - Changed lines counts per file
39
+
40
+ **`commit` / `commit-range`**: Use `git show` or `git diff` to extract the same information as `working-diff`.
41
+
42
+ **`explicit-files`**: Verify each file exists and categorize by module/directory.
43
+
44
+ 3. **Handle Edge Cases**:
45
+ - **No git repository**: Ask the user for affected files instead of failing silently
46
+ - **Binary files in diff**: Note them but don't attempt to parse
47
+ - **Ambiguous scope**: Ask the user for clarification instead of assuming
48
+ - **Empty diff**: Report that no changes were detected
49
+
50
+ ## Output Structure
51
+
52
+ Produce a structured scope object for downstream consumers:
53
+
54
+ ```markdown
55
+ ## Change Scope
56
+
57
+ - **Mode**: proposal | working-diff | commit | commit-range | explicit-files
58
+ - **Confidence**: verified | estimated
59
+ - **Inspected**: <what was examined>
60
+
61
+ ### Changed Paths
62
+ | File | Status | Module |
63
+ |---|---|---|
64
+ | src/auth/middleware.ts | modified | auth |
65
+ | src/auth/rate-limiter.ts | added | auth |
66
+
67
+ ### Affected Modules
68
+ - `auth` — authentication and rate limiting
69
+ - `api` — API route handlers
70
+
71
+ ### Ambiguities
72
+ - <anything unclear about the scope>
73
+ ```
74
+
75
+ ## Rules
76
+
77
+ - Never guess when the scope is unclear — ask
78
+ - Always report the detection mode and confidence level
79
+ - When the repository is not under git and no files are named, request explicit input
80
+ - This capability is analytical only — it must not modify product code
81
+
82
+ ## Quality Gates
83
+
84
+ - [ ] Mode is explicitly stated
85
+ - [ ] Changed paths are enumerated (or reason for absence is stated)
86
+ - [ ] Confidence level is assigned
87
+ - [ ] Ambiguities are flagged rather than silently resolved
88
+
89
+ ## Cross-References
90
+
91
+ - Used by: `impact-analysis-engine`, `incremental-sync-engine`, `engineering-change-review`
92
+ - Feeds into: `analyze-impact`, `sync-engineering-intelligence`, `review-engineering-change` workflows
@@ -1,13 +1,133 @@
1
1
  ---
2
2
  name: change-history-engine
3
3
  description: Records validated engineering work, impacted systems, tests, synchronized documentation, and outstanding risks. Use after initialization and completed engineering changes.
4
+ version: 3.0.0
4
5
  ---
5
6
 
6
- # Change History
7
+ # Change History Engine
7
8
 
8
- Store change records in `.changes/`.
9
+ Create structured, traceable change records that document what was done, why, what was tested, and what remains.
9
10
 
10
- - Initialization creates `CHG-000-initialization.md`.
11
- - Subsequent changes create the next numbered `CHG-XXX-<summary>.md`.
11
+ ## Inputs
12
12
 
13
- Include request summary, files or systems affected, related `IMP-*` and `REV-*` reports when present, implementation summary, tests and validation performed, updated graph/intelligence artifacts, and unresolved risk or follow-up.
13
+ - Completed implementation details
14
+ - Impact report reference
15
+ - Test results
16
+ - List of synchronized intelligence artifacts
17
+ - Unresolved risks or follow-ups
18
+
19
+ ## Change Record Format
20
+
21
+ Store change records in `.changes/`:
22
+
23
+ - Initialization creates `CHG-000-initialization.md`
24
+ - Subsequent changes create the next numbered `CHG-XXX-<summary>.md`
25
+
26
+ ### Numbering Convention
27
+
28
+ - `CHG-000` — Reserved for initialization
29
+ - `CHG-001` through `CHG-999` — Sequential, zero-padded
30
+ - Find the highest existing CHG number and increment by 1
31
+
32
+ ### Record Template
33
+
34
+ ```markdown
35
+ # CHG-XXX: <concise summary>
36
+
37
+ ## Meta
38
+ - Date: <ISO timestamp>
39
+ - Type: feature | bugfix | update | refactor | architecture | infrastructure | security
40
+ - Risk: low | medium | high | critical
41
+ - Author: <who requested the change>
42
+
43
+ ## Request
44
+ <Original user request, verbatim or paraphrased>
45
+
46
+ ## Implementation Summary
47
+ <What was changed, in 2-5 sentences>
48
+
49
+ ## Files Changed
50
+ | File | Action | Description |
51
+ |---|---|---|
52
+ | src/auth/middleware.ts | Modified | Added rate limiting check |
53
+ | src/auth/rate-limiter.ts | Created | New rate limiting service |
54
+ | test/auth/rate-limiter.test.ts | Created | Rate limiter unit tests |
55
+
56
+ ## Related Reports
57
+ - Impact: IMP-XXX-<slug>.md
58
+ - Review: REV-XXX-<slug>.md (if applicable)
59
+
60
+ ## Tests & Validation
61
+ | Test | Command | Result |
62
+ |---|---|---|
63
+ | Unit tests | npm test | 42 passed, 0 failed |
64
+ | Type check | npx tsc --noEmit | Clean |
65
+ | Lint | npm run lint | Clean |
66
+
67
+ ## Synchronized Artifacts
68
+ | Artifact | Change |
69
+ |---|---|
70
+ | knowledge-base/04-api-documentation.md | Updated rate limiting section |
71
+ | .engineering-intelligence/graph/runtime-graph.json | Added rate-limiter node |
72
+ | .engineering-intelligence/context/module-map.md | Added rate-limiter entry |
73
+
74
+ ## Unresolved Risks
75
+ - <any remaining concerns, follow-ups, or known limitations>
76
+
77
+ ## Rollback
78
+ - <how to revert this change if needed>
79
+ ```
80
+
81
+ ### Initialization Record (`CHG-000-initialization.md`)
82
+
83
+ ```markdown
84
+ # CHG-000: Project Intelligence Initialization
85
+
86
+ ## Meta
87
+ - Date: <ISO timestamp>
88
+ - Type: initialization
89
+
90
+ ## Summary
91
+ Initial engineering intelligence generated for <project name>.
92
+
93
+ ## Generated Artifacts
94
+ | Category | Count | Path |
95
+ |---|---|---|
96
+ | Knowledge Base | 16 documents | knowledge-base/ |
97
+ | Memory | 5 documents | .engineering-intelligence/memory/ |
98
+ | Context | 6 maps | .engineering-intelligence/context/ |
99
+ | Events | 5 guides | .engineering-intelligence/events/ |
100
+ | Graphs | 4 JSON + 1 map | .engineering-intelligence/graph/ |
101
+
102
+ ## Confidence Assessment
103
+ - High confidence areas: <list>
104
+ - Low confidence areas: <list>
105
+ - Needs human review: <list>
106
+
107
+ ## Next Steps
108
+ - Review and verify knowledge-base accuracy
109
+ - Confirm architecture decisions in memory
110
+ - Validate graph completeness
111
+ ```
112
+
113
+ ## Rules
114
+
115
+ - Every completed engineering change must have a change record
116
+ - Records are append-only — never delete or modify past records
117
+ - Reference related impact and review reports by their IMP/REV identifiers
118
+ - Be honest about test results — record failures and skipped tests
119
+ - Include rollback guidance for medium+ risk changes
120
+
121
+ ## Quality Gates
122
+
123
+ - [ ] Record number is sequential (no gaps, no duplicates)
124
+ - [ ] All sections are filled (use "N/A" rather than omitting)
125
+ - [ ] Related reports are correctly referenced
126
+ - [ ] Test results reflect actual execution (not assumed)
127
+ - [ ] Files changed list is complete
128
+
129
+ ## Cross-References
130
+
131
+ - Used by: `engineering-intelligence-skill` (step 7), `initialize-intelligence-skill` (step 9)
132
+ - Depends on: `impact-analysis-engine` (for report references)
133
+ - Related: `engineering-change-review` (may trigger a review report)