engineering-intelligence 0.2.0 → 0.4.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 (44) hide show
  1. package/README.md +5 -1
  2. package/dist/adapters/index.js +3 -3
  3. package/dist/adapters/index.js.map +1 -1
  4. package/dist/cli/index.js +24 -3
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/templates.d.ts +1 -1
  7. package/dist/templates.js +2 -2
  8. package/dist/templates.js.map +1 -1
  9. package/dist/validation/index.js +1 -1
  10. package/dist/validation/index.js.map +1 -1
  11. package/dist/visualizer/index.d.ts +2 -0
  12. package/dist/visualizer/index.d.ts.map +1 -0
  13. package/dist/visualizer/index.js +599 -0
  14. package/dist/visualizer/index.js.map +1 -0
  15. package/package.json +3 -3
  16. package/templates/canonical/agents/change-agent.md +58 -1
  17. package/templates/canonical/agents/engineering-orchestrator.md +69 -3
  18. package/templates/canonical/agents/knowledge-agent.md +59 -2
  19. package/templates/canonical/agents/quality-agent.md +59 -2
  20. package/templates/canonical/rules/engineering-intelligence.md +42 -13
  21. package/templates/canonical/skills/architecture-review-engine/SKILL.md +112 -3
  22. package/templates/canonical/skills/change-detection-engine/SKILL.md +82 -7
  23. package/templates/canonical/skills/change-history-engine/SKILL.md +125 -5
  24. package/templates/canonical/skills/context-sync-engine/SKILL.md +116 -9
  25. package/templates/canonical/skills/deep-project-knowledge-extractor/SKILL.md +171 -5
  26. package/templates/canonical/skills/engineering-change-review/SKILL.md +145 -9
  27. package/templates/canonical/skills/engineering-intelligence-skill/SKILL.md +168 -0
  28. package/templates/canonical/skills/graph-engine/SKILL.md +134 -14
  29. package/templates/canonical/skills/impact-analysis-engine/SKILL.md +125 -11
  30. package/templates/canonical/skills/incremental-sync-engine/SKILL.md +75 -10
  31. package/templates/canonical/skills/initialize-intelligence-skill/SKILL.md +130 -0
  32. package/templates/canonical/skills/knowledge-base-validator/SKILL.md +92 -7
  33. package/templates/canonical/skills/knowledge-sync-engine/SKILL.md +77 -8
  34. package/templates/canonical/skills/memory-sync-engine/SKILL.md +70 -8
  35. package/templates/canonical/skills/refactoring-planner/SKILL.md +143 -2
  36. package/templates/canonical/skills/testing-intelligence-engine/SKILL.md +119 -3
  37. package/templates/canonical/workflows/analyze-impact.md +25 -3
  38. package/templates/canonical/workflows/engineering-intelligence.md +20 -3
  39. package/templates/canonical/workflows/initialize-engineering-intelligence.md +30 -3
  40. package/templates/canonical/workflows/map-architecture.md +17 -6
  41. package/templates/canonical/workflows/review-engineering-change.md +26 -2
  42. package/templates/canonical/workflows/sync-engineering-intelligence.md +20 -2
  43. package/templates/canonical/skills/engineering-intelligence/SKILL.md +0 -21
  44. package/templates/canonical/skills/initialize-engineering-intelligence/SKILL.md +0 -32
@@ -1,10 +1,126 @@
1
1
  ---
2
2
  name: testing-intelligence-engine
3
3
  description: Determines risk-based testing needs for engineering changes and identifies coverage gaps in critical runtime flows. Use during implementation and validation.
4
+ version: 3.0.0
4
5
  ---
5
6
 
6
- # Testing Intelligence
7
+ # Testing Intelligence Engine
7
8
 
8
- Inspect existing test patterns and identify the smallest sufficient validation for the impacted behavior. Include unit, integration, end-to-end, migration, security, or operational checks when risk requires them.
9
+ Determine the minimum sufficient test coverage for a change based on risk assessment and existing test patterns.
9
10
 
10
- When documenting broad testing posture, update `knowledge-base/17-testing-strategy.md`. For individual changes, record tests run and remaining gaps in the relevant `.changes/` entry.
11
+ ## Inputs
12
+
13
+ - Impact report (`.engineering-intelligence/reports/IMP-XXX-*.md`)
14
+ - Existing test patterns in the repository
15
+ - Change classification (feature, bugfix, refactor, etc.)
16
+
17
+ ## Risk-Based Test Selection Matrix
18
+
19
+ | Risk Level | Unit Tests | Integration Tests | E2E Tests | Security Tests | Migration Tests | Manual |
20
+ |---|---|---|---|---|---|---|
21
+ | **Low** | Changed functions | — | — | — | — | — |
22
+ | **Medium** | Changed + adjacent | Affected APIs | — | — | — | — |
23
+ | **High** | Changed + adjacent | Affected APIs | Critical paths | If auth touched | If schema touched | Recommended |
24
+ | **Critical** | Comprehensive | All affected | Full suite | Required | Required | Required |
25
+
26
+ ## Procedure
27
+
28
+ 1. **Assess Existing Coverage** — Scan the test suite:
29
+ - Identify test framework(s) in use (Jest, Mocha, pytest, Go testing, etc.)
30
+ - Locate test directories and naming patterns
31
+ - Map tests to source files (by convention or configuration)
32
+ - Identify untested critical paths
33
+
34
+ 2. **Map Change to Tests** — Using the impact report:
35
+ - List source files/functions changed
36
+ - Find existing tests covering those files
37
+ - Identify tests that should exist but don't (coverage gaps)
38
+
39
+ 3. **Determine Required Tests** — Using the risk matrix above:
40
+
41
+ **For `bugfix`**:
42
+ - Regression test reproducing the original bug (required)
43
+ - Verify fix doesn't break adjacent behavior
44
+
45
+ **For `feature`**:
46
+ - Unit tests for new functions/methods
47
+ - Integration tests for new API endpoints or service interactions
48
+ - Happy path + error path coverage
49
+
50
+ **For `refactor`**:
51
+ - All existing tests must still pass (no new tests needed if behavior unchanged)
52
+ - Add tests if coverage gaps are discovered during refactoring
53
+
54
+ **For `architecture` / `security`**:
55
+ - Boundary tests between new/changed architectural boundaries
56
+ - Negative-path and permission tests for security changes
57
+ - Data migration and rollback tests for schema changes
58
+
59
+ 4. **Identify Coverage Gaps** — Report:
60
+ - Critical paths with no test coverage
61
+ - Changed behavior with no corresponding test
62
+ - Error paths and edge cases not covered
63
+
64
+ 5. **Recommend Test Strategy** — For the specific change, recommend:
65
+ - Test files to create or modify
66
+ - Test cases to write (describe what, not write the test code)
67
+ - Validation commands to run
68
+
69
+ ## Output
70
+
71
+ ### Per-Change Testing (in `.changes/CHG-XXX-*.md`)
72
+
73
+ ```markdown
74
+ ## Tests
75
+ - Added: <test file> — <what it tests>
76
+ - Modified: <test file> — <what changed>
77
+ - Run command: `npm test` / `pytest` / etc.
78
+ - Results: X passed, Y failed, Z skipped
79
+ - Coverage gaps: <untested areas remaining>
80
+ ```
81
+
82
+ ### Broad Testing Strategy (in `knowledge-base/17-testing-strategy.md`)
83
+
84
+ Only update when documenting project-wide testing posture:
85
+
86
+ ```markdown
87
+ # Testing Strategy
88
+
89
+ ## Test Framework
90
+ - Framework: <name and version>
91
+ - Configuration: <config file path>
92
+
93
+ ## Test Organization
94
+ | Directory | Type | Coverage |
95
+ |---|---|---|
96
+ | test/unit/ | Unit tests | Core business logic |
97
+ | test/integration/ | Integration | API endpoints |
98
+
99
+ ## Coverage Gaps
100
+ - <critical untested areas>
101
+
102
+ ## Running Tests
103
+ - All tests: `<command>`
104
+ - Specific suite: `<command>`
105
+ - Coverage report: `<command>`
106
+ ```
107
+
108
+ ## Rules
109
+
110
+ - Recommend tests proportional to risk — don't mandate full-suite runs for low-risk changes
111
+ - Always note when validation was not actually run (only recommended)
112
+ - Never claim test coverage without checking existing tests
113
+ - Record test results honestly, including failures
114
+
115
+ ## Quality Gates
116
+
117
+ - [ ] Impact report was consulted for risk level
118
+ - [ ] Test recommendations match the risk level
119
+ - [ ] Existing test coverage was checked before recommending new tests
120
+ - [ ] Coverage gaps in critical paths are flagged
121
+
122
+ ## Cross-References
123
+
124
+ - Depends on: `impact-analysis-engine` (for risk assessment)
125
+ - Used by: `engineering-intelligence-skill` (step 4: tests and validation)
126
+ - Updates: `knowledge-base/17-testing-strategy.md` (broad posture only)
@@ -6,8 +6,30 @@ description: Analyze the impact of a proposed change or existing diff and write
6
6
 
7
7
  Use `change-detection-engine`, `impact-analysis-engine`, and `graph-engine` when graph intelligence is missing or stale.
8
8
 
9
- Analyze the user-supplied proposed change, working-tree diff, commit/range, or explicit changed paths. If the scope is ambiguous, ask for it instead of assuming.
9
+ ## Input
10
10
 
11
- Write `.engineering-intelligence/reports/IMP-XXX-<slug>.md` covering analysis mode and scope, graph inputs, direct and indirect impact, risks, validation needs, intelligence artifacts needing synchronization, evidence, and uncertainties.
11
+ Analyze the user-supplied scope: proposed change description, working-tree diff, commit/range, or explicit changed paths. If the scope is ambiguous, ask for clarification instead of assuming.
12
12
 
13
- This workflow may write intelligence reports or refresh necessary graph context. It must not modify product code.
13
+ ## Output
14
+
15
+ Write `.engineering-intelligence/reports/IMP-XXX-<slug>.md` covering:
16
+
17
+ | Section | Content |
18
+ |---|---|
19
+ | Analysis mode & scope | `proposal` or `diff`, what was examined |
20
+ | Graph inputs | Graphs consulted, refreshed, or missing |
21
+ | Direct impact | Files and systems directly affected |
22
+ | Indirect impact | Downstream dependencies and consumers |
23
+ | Risk assessment | Risk level with justification |
24
+ | Validation needs | Tests and checks required |
25
+ | Intelligence artifacts | Knowledge, memory, context, events, and graphs needing sync |
26
+ | Evidence | File path citations for all claims |
27
+ | Unknowns | Areas where impact is uncertain |
28
+
29
+ ## Rules
30
+
31
+ - Ask for scope clarification when ambiguous — never assume
32
+ - Consult graph intelligence before tracing impact manually
33
+ - Score risk with evidence-based justification
34
+ - This workflow may write intelligence reports or refresh necessary graph context
35
+ - It must not modify product code
@@ -4,8 +4,25 @@ description: Implement an engineering request with impact analysis, tests, valid
4
4
 
5
5
  # Engineering Intelligence
6
6
 
7
- Use the `engineering-intelligence` capability for the user's accompanying request.
7
+ Use the `engineering-intelligence-skill` capability for the user's accompanying request.
8
8
 
9
- Read project intelligence and graph artifacts, write a pre-change `.engineering-intelligence/reports/IMP-XXX-<summary>.md` impact report, implement the requested work, add or update appropriate tests, validate the result, incrementally synchronize affected knowledge/memory/context/event/graph artifacts, and write the next `.changes/CHG-XXX-<summary>.md` entry referencing related reports. Run review responsibility before completion when change risk is high.
9
+ ## Pipeline
10
10
 
11
- Finish with changed code, tests and validation, affected systems, synchronized artifacts and graphs, related reports, and unresolved risks.
11
+ 1. **Read Intelligence** Consult `knowledge-base/`, `.engineering-intelligence/memory/`, `.engineering-intelligence/context/`, `.engineering-intelligence/graph/`
12
+ 2. **Write Impact Report** — Create `.engineering-intelligence/reports/IMP-XXX-<summary>.md` before any code edit
13
+ 3. **Implement** — Make the requested code changes following established patterns
14
+ 4. **Test** — Add/update tests proportional to risk; execute and record results
15
+ 5. **Validate** — Run available linters, type checks, and test suites
16
+ 6. **Sync Intelligence** — Incrementally update only affected knowledge, memory, context, event, graph artifacts
17
+ 7. **Record Change** — Write `.changes/CHG-XXX-<summary>.md` referencing related reports
18
+ 8. **Review Gate** — For high-risk changes, run engineering-change review before completion
19
+
20
+ ## Completion Report
21
+
22
+ Finish with:
23
+ - Code changes made (files, what changed)
24
+ - Tests run and results (pass/fail counts)
25
+ - Affected systems and services
26
+ - Synchronized intelligence artifacts
27
+ - Related reports (IMP-XXX, REV-XXX)
28
+ - Unresolved risks or follow-ups
@@ -4,8 +4,35 @@ description: Initialize evidence-based engineering intelligence for the current
4
4
 
5
5
  # Initialize Engineering Intelligence
6
6
 
7
- Use the `initialize-engineering-intelligence` capability.
7
+ Use the `initialize-intelligence-skill` capability.
8
8
 
9
- Analyze this repository thoroughly without changing product code. Generate `knowledge-base/`, validate it against evidence, generate `.engineering-intelligence/memory/`, `.engineering-intelligence/context/`, `.engineering-intelligence/events/`, and build `.engineering-intelligence/graph/` JSON graphs plus `architecture-map.md`. Write `.changes/CHG-000-initialization.md`.
9
+ ## What This Does
10
10
 
11
- Do not fabricate details. Mark uncertainty clearly and finish with the created artifacts and human-review items.
11
+ Analyzes this repository thoroughly without changing product code. Produces a complete project intelligence baseline.
12
+
13
+ ## Outputs Generated
14
+
15
+ | Category | Path | Content |
16
+ |---|---|---|
17
+ | Knowledge Base | `knowledge-base/` | 16 evidence-backed documents (00-15) |
18
+ | Memory | `.engineering-intelligence/memory/` | 5 durable decision/pattern documents |
19
+ | Context | `.engineering-intelligence/context/` | 6 compact navigation maps |
20
+ | Events | `.engineering-intelligence/events/` | 5 change-event guidance documents |
21
+ | Graphs | `.engineering-intelligence/graph/` | 4 JSON graphs + architecture-map.md |
22
+ | History | `.changes/CHG-000-initialization.md` | Initialization record |
23
+
24
+ ## Execution Steps
25
+
26
+ 1. **Discover** — Scan repository for packages, runtimes, build systems, APIs, databases, auth, CI, and tests
27
+ 2. **Extract** — Generate knowledge-base documents with evidence citations
28
+ 3. **Validate** — Audit claims against source code; write validation report
29
+ 4. **Generate Memory** — Extract durable decisions and patterns
30
+ 5. **Generate Context** — Create concise AI navigation maps
31
+ 6. **Build Graphs** — Generate evidence-backed architecture graphs
32
+ 7. **Record** — Write initialization change record
33
+
34
+ ## Important
35
+
36
+ - Do not fabricate details — mark uncertainty clearly
37
+ - Every claim must cite evidence from the repository
38
+ - Finish with: created artifacts, confidence assessment, and human-review items
@@ -8,10 +8,21 @@ Use the `graph-engine` capability.
8
8
 
9
9
  Inspect repository evidence and generate or comprehensively refresh:
10
10
 
11
- - `.engineering-intelligence/graph/dependency-graph.json`
12
- - `.engineering-intelligence/graph/service-graph.json`
13
- - `.engineering-intelligence/graph/runtime-graph.json`
14
- - `.engineering-intelligence/graph/business-flow-graph.json`
15
- - `.engineering-intelligence/graph/architecture-map.md`
11
+ | Artifact | Content |
12
+ |---|---|
13
+ | `.engineering-intelligence/graph/dependency-graph.json` | Module/package dependency relationships |
14
+ | `.engineering-intelligence/graph/service-graph.json` | Service-to-service communication topology |
15
+ | `.engineering-intelligence/graph/runtime-graph.json` | Runtime call flows and middleware chains |
16
+ | `.engineering-intelligence/graph/business-flow-graph.json` | Business process flows across boundaries |
17
+ | `.engineering-intelligence/graph/architecture-map.md` | Mermaid diagrams derived from JSON graphs |
16
18
 
17
- Use stable node IDs, evidence-backed confidence labels, explicit unknowns, and Mermaid diagrams. You may update graph-connected navigation context when necessary. Do not modify product code.
19
+ ## Requirements
20
+
21
+ - Use stable node IDs across updates
22
+ - Mark every edge with `verified`, `inferred`, or `unknown` confidence
23
+ - Back every `verified` edge with evidence file paths
24
+ - List unresolved relationships in the `unknowns` array
25
+ - Derive Mermaid diagrams from JSON graph data — not hand-authored
26
+ - Update graph-connected navigation context when necessary
27
+
28
+ This workflow may update graph and context intelligence artifacts. It must not modify product code.
@@ -6,6 +6,30 @@ description: Review changed engineering work, tests, graphs, and synchronized in
6
6
 
7
7
  Use `change-detection-engine` and `engineering-change-review`.
8
8
 
9
- Inspect the identified implementation diff or changed scope, associated impact report, test and validation evidence, graph consistency, and documentation/context synchronization.
9
+ ## Procedure
10
10
 
11
- Write `.engineering-intelligence/reports/REV-XXX-<slug>.md` with severity-ordered findings, evidence paths, test gaps, and stale-intelligence risks. Do not modify product code or auto-fix findings.
11
+ 1. **Detect scope** Identify the implementation diff or changed scope
12
+ 2. **Read context** — Load associated impact report, test evidence, and graph artifacts
13
+ 3. **Review** — Inspect across five dimensions:
14
+
15
+ | Dimension | What to Check |
16
+ |---|---|
17
+ | Implementation | Correctness, request fulfillment, error handling |
18
+ | Tests | Coverage, execution, results, gaps |
19
+ | Architecture | Boundary respect, pattern compliance, dependency direction |
20
+ | Graph consistency | New/changed nodes and edges reflected |
21
+ | Documentation sync | Knowledge, memory, context accuracy |
22
+
23
+ 4. **Write report** — Generate `.engineering-intelligence/reports/REV-XXX-<slug>.md` with:
24
+ - Severity-ordered findings (🔴 Blocker → 🟢 Positive)
25
+ - Evidence paths for each finding
26
+ - Test gaps and coverage concerns
27
+ - Stale-intelligence risks
28
+ - Verdict: Approved / Approved with findings / Changes required
29
+
30
+ ## Rules
31
+
32
+ - Do not modify product code
33
+ - Do not auto-fix findings — report only
34
+ - Include positive observations alongside issues
35
+ - Flag unrun validation honestly
@@ -6,6 +6,24 @@ description: Incrementally synchronize intelligence artifacts for an identified
6
6
 
7
7
  Use `change-detection-engine`, `impact-analysis-engine`, and `incremental-sync-engine`.
8
8
 
9
- Read the supplied changed scope, diff, or completed change record. Create an impact report first if none exists for that scope. Update only affected knowledge, memory, context, event, graph, and report artifacts.
9
+ ## Procedure
10
10
 
11
- Standalone synchronization must not create a `.changes/CHG-XXX-*` implementation record and must not modify product code.
11
+ 1. **Detect scope** Read the supplied changed scope, diff, or completed change record
12
+ 2. **Analyze impact** — Create an impact report first if none exists for this scope
13
+ 3. **Sync artifacts** — Update only affected intelligence:
14
+
15
+ | Artifact Type | Engine | Update Rule |
16
+ |---|---|---|
17
+ | Knowledge Base | `knowledge-sync-engine` | Only docs mapped to the change type |
18
+ | Memory | `memory-sync-engine` | Only if durable decisions changed |
19
+ | Context | `context-sync-engine` | Only affected navigation maps |
20
+ | Events | Direct update | Only if API/schema/auth contracts changed |
21
+ | Graphs | `graph-engine` (incremental) | Only affected nodes and edges |
22
+ | Reports | Impact report update | Add sync notes |
23
+
24
+ ## Rules
25
+
26
+ - Standalone synchronization must not create `.changes/CHG-XXX-*` implementation records
27
+ - Must not modify product code
28
+ - Update only artifacts identified by the impact report
29
+ - Preserve accurate existing content in all artifacts
@@ -1,21 +0,0 @@
1
- ---
2
- name: engineering-intelligence
3
- description: Executes engineering changes with impact analysis, implementation, tests, validation, and incremental synchronization of project intelligence. Use for feature, bugfix, update, refactor, architecture, infrastructure, or security requests.
4
- ---
5
-
6
- # Engineering Intelligence Workflow
7
-
8
- Use this workflow for implementation requests after project intelligence has been initialized.
9
-
10
- ## Procedure
11
-
12
- 1. Read relevant files from `knowledge-base/`, `.engineering-intelligence/memory/`, `.engineering-intelligence/context/`, and `.engineering-intelligence/graph/`. If missing, run the initialization capability first.
13
- 2. Classify the request and write a pre-change `.engineering-intelligence/reports/IMP-XXX-<summary>.md` impact report before editing.
14
- 3. Implement the requested change in the project code.
15
- 4. Add or update relevant tests and execute the appropriate validation available in the project.
16
- 5. Use incremental synchronization to update only affected knowledge-base, memory, context, event, graph, and report artifacts.
17
- 6. Create the next `.changes/CHG-XXX-<summary>.md` record referencing related impact and any review reports.
18
- 7. For high-risk changes, run engineering-change review before final reporting.
19
- 8. Report code changes, tests run, affected systems, synchronized documentation/graph artifacts, and unresolved risks.
20
-
21
- Do not claim validation succeeded unless it ran successfully. Do not update unrelated documents merely to regenerate them.
@@ -1,32 +0,0 @@
1
- ---
2
- name: initialize-engineering-intelligence
3
- description: Initializes project engineering intelligence by analyzing repository evidence and generating knowledge, context, memory, event guidance, architecture graphs, and an initialization change record. Use when onboarding a repository or when asked to initialize engineering intelligence.
4
- ---
5
-
6
- # Initialize Engineering Intelligence
7
-
8
- Create a trustworthy project intelligence baseline. Analyze only evidence present in source code, configuration, tests, infrastructure, and existing documentation. Mark unknowns and uncertainties explicitly; never invent architecture, APIs, schemas, or business rules.
9
-
10
- ## Outputs
11
-
12
- Generate:
13
-
14
- - `knowledge-base/00-project-overview.md` through `knowledge-base/15-validation-report.md`
15
- - `.engineering-intelligence/memory/` for durable decisions, rules, patterns, constraints, and technology decisions
16
- - `.engineering-intelligence/context/` for module, service, runtime, dependency, critical-path, and dangerous-area maps
17
- - `.engineering-intelligence/events/` for API, schema, auth, feature, and infrastructure change guidance
18
- - `.engineering-intelligence/graph/` for JSON dependency, service, runtime, and business-flow graphs plus a Mermaid architecture map
19
- - `.changes/CHG-000-initialization.md`
20
-
21
- ## Procedure
22
-
23
- 1. Discover repositories, packages, runtimes, build systems, entrypoints, CI, deployment, environment examples, databases, APIs, auth, and tests.
24
- 2. Trace architecture and critical runtime flows from code evidence.
25
- 3. Write the knowledge base with file-backed evidence and clearly labeled unknowns.
26
- 4. Validate major documentation claims against the project and write `15-validation-report.md`.
27
- 5. Generate compact durable memory and navigation context from validated findings.
28
- 6. Use `graph-engine` to generate a full evidence-backed graph baseline and `architecture-map.md`.
29
- 7. Generate change-event guidance and initialization history.
30
- 8. Report generated artifacts, confidence limits, and areas requiring human confirmation.
31
-
32
- This initialization workflow documents and validates the project. It does not implement product changes.