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.
- package/README.md +4 -0
- package/dist/cli/index.js +24 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/templates.d.ts +1 -1
- package/dist/templates.js +2 -2
- package/dist/templates.js.map +1 -1
- package/dist/visualizer/index.d.ts +2 -0
- package/dist/visualizer/index.d.ts.map +1 -0
- package/dist/visualizer/index.js +599 -0
- package/dist/visualizer/index.js.map +1 -0
- package/package.json +2 -2
- package/templates/canonical/agents/change-agent.md +58 -1
- package/templates/canonical/agents/engineering-orchestrator.md +69 -3
- package/templates/canonical/agents/knowledge-agent.md +59 -2
- package/templates/canonical/agents/quality-agent.md +59 -2
- package/templates/canonical/rules/engineering-intelligence.md +42 -13
- package/templates/canonical/skills/architecture-review-engine/SKILL.md +112 -3
- package/templates/canonical/skills/change-detection-engine/SKILL.md +82 -7
- package/templates/canonical/skills/change-history-engine/SKILL.md +125 -5
- package/templates/canonical/skills/context-sync-engine/SKILL.md +116 -9
- package/templates/canonical/skills/deep-project-knowledge-extractor/SKILL.md +171 -5
- package/templates/canonical/skills/engineering-change-review/SKILL.md +145 -9
- package/templates/canonical/skills/engineering-intelligence-skill/SKILL.md +168 -0
- package/templates/canonical/skills/graph-engine/SKILL.md +134 -14
- package/templates/canonical/skills/impact-analysis-engine/SKILL.md +125 -11
- package/templates/canonical/skills/incremental-sync-engine/SKILL.md +75 -10
- package/templates/canonical/skills/initialize-intelligence-skill/SKILL.md +130 -0
- package/templates/canonical/skills/knowledge-base-validator/SKILL.md +92 -7
- package/templates/canonical/skills/knowledge-sync-engine/SKILL.md +77 -8
- package/templates/canonical/skills/memory-sync-engine/SKILL.md +70 -8
- package/templates/canonical/skills/refactoring-planner/SKILL.md +143 -2
- package/templates/canonical/skills/testing-intelligence-engine/SKILL.md +119 -3
- package/templates/canonical/workflows/analyze-impact.md +25 -3
- package/templates/canonical/workflows/engineering-intelligence.md +20 -3
- package/templates/canonical/workflows/initialize-engineering-intelligence.md +30 -3
- package/templates/canonical/workflows/map-architecture.md +17 -6
- package/templates/canonical/workflows/review-engineering-change.md +26 -2
- package/templates/canonical/workflows/sync-engineering-intelligence.md +20 -2
- package/templates/canonical/skills/engineering-intelligence/SKILL.md +0 -21
- package/templates/canonical/skills/initialize-engineering-intelligence/SKILL.md +0 -32
|
@@ -1,17 +1,86 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: knowledge-sync-engine
|
|
3
3
|
description: Incrementally synchronizes the project knowledge base after code changes, updating only documents affected by verified behavior changes. Use after implementation or architectural decisions.
|
|
4
|
+
version: 3.0.0
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Knowledge Synchronization
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Update only the knowledge-base documents affected by a verified behavior change. Preserve accurate existing content — never regenerate entire documents.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
- persistence/schema: `knowledge-base/05-database.md`
|
|
12
|
-
- authentication/authorization: `knowledge-base/06-authentication.md`
|
|
13
|
-
- runtime flow: `knowledge-base/03-runtime-flow.md`
|
|
14
|
-
- architecture: `knowledge-base/02-architecture.md`
|
|
15
|
-
- frontend/backend/infrastructure/integrations: corresponding knowledge documents
|
|
11
|
+
## Inputs
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
- Persisted impact report (`.engineering-intelligence/reports/IMP-XXX-*.md`)
|
|
14
|
+
- Actual diff or change record showing what changed
|
|
15
|
+
- Current `knowledge-base/` documents
|
|
16
|
+
|
|
17
|
+
## Document-to-Change Mapping
|
|
18
|
+
|
|
19
|
+
| Change Category | Primary Document | Also Check |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| API routes, endpoints, payloads | `04-api-documentation.md` | `03-runtime-flow.md` |
|
|
22
|
+
| Database schema, migrations | `05-database.md` | `02-architecture.md` |
|
|
23
|
+
| Auth flows, permissions | `06-authentication.md` | `03-runtime-flow.md`, `11-complex-areas.md` |
|
|
24
|
+
| Frontend components, routing | `07-frontend.md` | `01-repository-structure.md` |
|
|
25
|
+
| Backend services, middleware | `08-backend.md` | `03-runtime-flow.md` |
|
|
26
|
+
| CI/CD, deployment, hosting | `09-infrastructure.md` | — |
|
|
27
|
+
| Third-party integrations | `10-integrations.md` | `01-repository-structure.md` |
|
|
28
|
+
| New complex logic | `11-complex-areas.md` | — |
|
|
29
|
+
| Debt introduced or resolved | `12-technical-debt.md` | — |
|
|
30
|
+
| Dev workflow changes | `13-onboarding.md` | — |
|
|
31
|
+
| New domain terms | `14-glossary.md` | — |
|
|
32
|
+
| Architecture changes | `02-architecture.md` | `01-repository-structure.md`, `03-runtime-flow.md` |
|
|
33
|
+
| New packages or modules | `01-repository-structure.md` | `02-architecture.md` |
|
|
34
|
+
| Project overview changes | `00-project-overview.md` | — |
|
|
35
|
+
|
|
36
|
+
## Procedure
|
|
37
|
+
|
|
38
|
+
1. **Read Impact Report** — Identify which knowledge documents are flagged as affected.
|
|
39
|
+
|
|
40
|
+
2. **Read Affected Documents** — Load only the documents identified in step 1.
|
|
41
|
+
|
|
42
|
+
3. **Identify Stale Sections** — For each affected document, find the specific sections that reference changed code, APIs, schemas, or behavior.
|
|
43
|
+
|
|
44
|
+
4. **Update Sections** — For each stale section:
|
|
45
|
+
- Rewrite with current, accurate information
|
|
46
|
+
- Add evidence citations: `(evidence: path/to/file:L42)`
|
|
47
|
+
- Mark uncertain areas: `**Unclear from evidence** — [reason]`
|
|
48
|
+
- Preserve all unaffected content exactly as-is
|
|
49
|
+
|
|
50
|
+
5. **Verify Consistency** — Check that updated sections don't contradict other sections in the same document or other knowledge documents.
|
|
51
|
+
|
|
52
|
+
## Evidence Attachment Format
|
|
53
|
+
|
|
54
|
+
Every changed claim must include an evidence citation:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
The auth middleware now validates JWT tokens using RS256 algorithm
|
|
58
|
+
(evidence: src/middleware/auth.ts:L15-L28)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For removed features:
|
|
62
|
+
```markdown
|
|
63
|
+
~~OAuth2 PKCE flow support~~ — Removed in CHG-015
|
|
64
|
+
(evidence: git diff, src/auth/oauth.ts deleted)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Rules
|
|
68
|
+
|
|
69
|
+
- Update only documents and sections identified by the impact report
|
|
70
|
+
- Preserve all accurate existing content unchanged
|
|
71
|
+
- Attach evidence for every changed claim
|
|
72
|
+
- Never regenerate entire documents during incremental sync
|
|
73
|
+
- If unsure whether a claim is stale, flag it rather than silently rewriting
|
|
74
|
+
|
|
75
|
+
## Quality Gates
|
|
76
|
+
|
|
77
|
+
- [ ] Only impact-identified documents were modified
|
|
78
|
+
- [ ] Changed sections have evidence citations
|
|
79
|
+
- [ ] Accurate existing content was preserved
|
|
80
|
+
- [ ] No documents were fully regenerated
|
|
81
|
+
|
|
82
|
+
## Cross-References
|
|
83
|
+
|
|
84
|
+
- Depends on: `impact-analysis-engine` (identifies affected documents)
|
|
85
|
+
- Used by: `incremental-sync-engine`, `engineering-intelligence-skill`
|
|
86
|
+
- Related: `knowledge-base-validator` (validates after sync)
|
|
@@ -1,18 +1,80 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-sync-engine
|
|
3
3
|
description: Maintains durable engineering memory after architecture, business rule, constraint, convention, or technology decisions change. Use only for long-lived knowledge.
|
|
4
|
+
version: 3.0.0
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Memory Synchronization
|
|
7
8
|
|
|
8
|
-
Maintain
|
|
9
|
+
Maintain durable, long-lived engineering memory. Memory is for decisions and patterns that persist across many changes — never for transient implementation details.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
- `business-rules.md`
|
|
12
|
-
- `coding-patterns.md`
|
|
13
|
-
- `project-constraints.md`
|
|
14
|
-
- `technology-decisions.md`
|
|
11
|
+
## Inputs
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
- Impact report and actual change evidence
|
|
14
|
+
- Current `.engineering-intelligence/memory/` documents
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
## Memory Categories
|
|
17
|
+
|
|
18
|
+
| Document | Content | Update Trigger |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `architecture-decisions.md` | ADRs, layer definitions, boundary rules, communication patterns | Architecture changes, new service boundaries, pattern adoptions |
|
|
21
|
+
| `business-rules.md` | Domain invariants, validation rules, business logic constraints | Business logic changes, regulatory updates |
|
|
22
|
+
| `coding-patterns.md` | Recurring conventions, idioms, naming rules, file organization | Refactors that establish new patterns, convention changes |
|
|
23
|
+
| `project-constraints.md` | Performance budgets, compatibility requirements, SLA targets, regulatory | Infrastructure changes, new compliance requirements |
|
|
24
|
+
| `technology-decisions.md` | Stack choices, framework versions, deprecation timelines, migration plans | Dependency updates, technology migrations |
|
|
25
|
+
|
|
26
|
+
## Staleness Detection Rules
|
|
27
|
+
|
|
28
|
+
A memory entry may be stale if:
|
|
29
|
+
|
|
30
|
+
1. **Referenced code no longer exists** — The decision references files/modules that were deleted or renamed
|
|
31
|
+
2. **Contradicted by current code** — The pattern described is no longer followed in the codebase
|
|
32
|
+
3. **Superseded by new decision** — A newer decision overrides the documented one
|
|
33
|
+
4. **Evidence outdated** — The evidence citations point to significantly changed code
|
|
34
|
+
|
|
35
|
+
## Procedure
|
|
36
|
+
|
|
37
|
+
1. **Check Trigger** — Review the impact report. Does the change affect a durable decision, rule, constraint, pattern, or technology choice? If not, **stop — leave memory unchanged**.
|
|
38
|
+
|
|
39
|
+
2. **Identify Affected Entries** — Match the change against memory categories above. Only proceed for matching categories.
|
|
40
|
+
|
|
41
|
+
3. **Update Entry** — For each affected entry:
|
|
42
|
+
```markdown
|
|
43
|
+
## <Decision/Pattern Title>
|
|
44
|
+
|
|
45
|
+
**Status**: Active | Superseded | Deprecated
|
|
46
|
+
**Decided**: <date or CHG reference>
|
|
47
|
+
**Last verified**: <date>
|
|
48
|
+
|
|
49
|
+
<Description of the decision/pattern>
|
|
50
|
+
|
|
51
|
+
**Rationale**: <why this was chosen>
|
|
52
|
+
**Source**: (evidence: path/to/file)
|
|
53
|
+
**Alternatives considered**: <if applicable>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
4. **Verify Durability** — Before adding a new memory entry, confirm it's truly durable:
|
|
57
|
+
- Will this still be relevant after 5+ more changes?
|
|
58
|
+
- Is this a decision or just an implementation detail?
|
|
59
|
+
- Is this captured better elsewhere (knowledge-base, context)?
|
|
60
|
+
|
|
61
|
+
## Rules
|
|
62
|
+
|
|
63
|
+
- **Durable only**: Do not store transient implementation notes or unverified assumptions
|
|
64
|
+
- **Evidence required**: Every entry must cite source evidence
|
|
65
|
+
- **Leave unchanged when appropriate**: Most changes do NOT affect durable memory — it's correct to update nothing
|
|
66
|
+
- **Status tracking**: Mark superseded decisions as `Superseded` rather than deleting them — history matters
|
|
67
|
+
- **No product code**: Memory synchronization never modifies product code
|
|
68
|
+
|
|
69
|
+
## Quality Gates
|
|
70
|
+
|
|
71
|
+
- [ ] Change was verified to affect durable knowledge before updating
|
|
72
|
+
- [ ] Only affected entries were modified
|
|
73
|
+
- [ ] New entries are truly durable (not transient implementation details)
|
|
74
|
+
- [ ] All entries have evidence citations
|
|
75
|
+
- [ ] Superseded entries are marked, not deleted
|
|
76
|
+
|
|
77
|
+
## Cross-References
|
|
78
|
+
|
|
79
|
+
- Used by: `incremental-sync-engine`, `engineering-intelligence-skill`
|
|
80
|
+
- Consumed by: `engineering-orchestrator` (for routing decisions), `change-agent` (for pattern compliance)
|
|
@@ -1,10 +1,151 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: refactoring-planner
|
|
3
3
|
description: Plans safe refactors by identifying dependencies, migration steps, validation needs, compatibility risk, and rollback strategy. Use before non-trivial refactors.
|
|
4
|
+
version: 3.0.0
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Refactoring Planner
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Plan safe, incremental refactoring with clear migration steps, validation checkpoints, and rollback strategies.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
## Inputs
|
|
12
|
+
|
|
13
|
+
- Refactoring goal (described by user or identified by architecture review)
|
|
14
|
+
- `.engineering-intelligence/graph/` (dependency relationships)
|
|
15
|
+
- `knowledge-base/12-technical-debt.md` (existing debt)
|
|
16
|
+
- `.engineering-intelligence/memory/architecture-decisions.md` (constraints)
|
|
17
|
+
|
|
18
|
+
## Refactoring Categories
|
|
19
|
+
|
|
20
|
+
| Category | Examples | Risk Level |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| **Extract** | Extract module, service, function, interface | Medium |
|
|
23
|
+
| **Rename** | Rename module, restructure directories | Low–Medium |
|
|
24
|
+
| **Consolidate** | Merge duplicate logic, unify patterns | Medium |
|
|
25
|
+
| **Decouple** | Break circular deps, introduce interfaces | Medium–High |
|
|
26
|
+
| **Migrate** | Change framework, database, language version | High |
|
|
27
|
+
| **Restructure** | Redefine boundaries, change architecture pattern | High–Critical |
|
|
28
|
+
|
|
29
|
+
## Risk Scoring
|
|
30
|
+
|
|
31
|
+
| Factor | Low (1) | Medium (2) | High (3) | Critical (4) |
|
|
32
|
+
|---|---|---|---|---|
|
|
33
|
+
| **Scope** | 1–3 files | 4–10 files | 10–25 files | 25+ files |
|
|
34
|
+
| **Dependents** | 0–2 consumers | 3–5 consumers | 6–10 consumers | 10+ consumers |
|
|
35
|
+
| **Test coverage** | Well-tested | Partial | Sparse | None |
|
|
36
|
+
| **Data impact** | None | Read-only paths | Write paths | Schema changes |
|
|
37
|
+
| **Rollback** | Git revert | Multi-step | Complex | Irreversible |
|
|
38
|
+
|
|
39
|
+
**Overall Risk** = max(all factors). If any factor is Critical, the refactor is Critical.
|
|
40
|
+
|
|
41
|
+
## Procedure
|
|
42
|
+
|
|
43
|
+
1. **Analyze Current State** — Using graphs and knowledge base:
|
|
44
|
+
- Map the exact scope of the refactor
|
|
45
|
+
- Identify all dependents of the code to be changed
|
|
46
|
+
- Note test coverage for affected areas
|
|
47
|
+
- Check for related technical debt
|
|
48
|
+
|
|
49
|
+
2. **Design Target State** — Define:
|
|
50
|
+
- What the code should look like after refactoring
|
|
51
|
+
- New module/file structure (if changing boundaries)
|
|
52
|
+
- New interfaces or abstractions (if decoupling)
|
|
53
|
+
- Migration strategy for data (if applicable)
|
|
54
|
+
|
|
55
|
+
3. **Plan Migration Steps** — Break into incremental, independently-deployable steps:
|
|
56
|
+
```markdown
|
|
57
|
+
### Step 1: <name>
|
|
58
|
+
- Changes: <what to modify>
|
|
59
|
+
- Validation: <how to verify this step>
|
|
60
|
+
- Rollback: <how to revert just this step>
|
|
61
|
+
- Dependencies: <what must be done first>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
4. **Identify Validation Needs** — For each step:
|
|
65
|
+
- Existing tests that must pass
|
|
66
|
+
- New tests to add before refactoring
|
|
67
|
+
- Integration tests to verify behavior preservation
|
|
68
|
+
- Performance benchmarks (if applicable)
|
|
69
|
+
|
|
70
|
+
5. **Define Rollback Strategy** — For the overall refactor:
|
|
71
|
+
- Can it be reverted with `git revert`?
|
|
72
|
+
- Are there data migrations that need reverse migrations?
|
|
73
|
+
- What's the point of no return?
|
|
74
|
+
|
|
75
|
+
6. **Write Plan** — Generate `knowledge-base/18-refactor-plan.md`
|
|
76
|
+
|
|
77
|
+
## Output Format
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
# Refactoring Plan: <title>
|
|
81
|
+
|
|
82
|
+
## Motivation
|
|
83
|
+
<Why this refactor is needed — link to technical debt or architecture review>
|
|
84
|
+
|
|
85
|
+
## Current State
|
|
86
|
+
<What exists now, with file paths>
|
|
87
|
+
|
|
88
|
+
## Target State
|
|
89
|
+
<What should exist after, with proposed structure>
|
|
90
|
+
|
|
91
|
+
## Risk Assessment
|
|
92
|
+
| Factor | Rating | Justification |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| Scope | Medium | 8 files affected |
|
|
95
|
+
| Dependents | High | 7 modules import the target |
|
|
96
|
+
|
|
97
|
+
Overall Risk: **High**
|
|
98
|
+
|
|
99
|
+
## Migration Steps
|
|
100
|
+
|
|
101
|
+
### Step 1: Add new interface
|
|
102
|
+
- Files: src/interfaces/auth.ts (new)
|
|
103
|
+
- Validation: Type check passes
|
|
104
|
+
- Rollback: Delete the file
|
|
105
|
+
|
|
106
|
+
### Step 2: Implement adapter
|
|
107
|
+
- Files: src/auth/adapter.ts (new)
|
|
108
|
+
- Validation: Unit tests pass
|
|
109
|
+
- Rollback: Delete the file, revert imports
|
|
110
|
+
|
|
111
|
+
### Step 3: Migrate consumers (batch 1)
|
|
112
|
+
- Files: src/routes/users.ts, src/routes/admin.ts
|
|
113
|
+
- Validation: Integration tests pass
|
|
114
|
+
- Rollback: Revert consumer changes
|
|
115
|
+
|
|
116
|
+
## Validation Plan
|
|
117
|
+
- [ ] All existing tests pass after each step
|
|
118
|
+
- [ ] New tests added before behavior-preserving changes
|
|
119
|
+
- [ ] Integration suite green after full migration
|
|
120
|
+
|
|
121
|
+
## Rollback Strategy
|
|
122
|
+
- Steps 1-3 are independently revertible via git
|
|
123
|
+
- No data migrations required
|
|
124
|
+
- Point of no return: None — fully reversible
|
|
125
|
+
|
|
126
|
+
## Timeline Estimate
|
|
127
|
+
- Step 1: ~30 minutes
|
|
128
|
+
- Step 2: ~1 hour
|
|
129
|
+
- Step 3: ~2 hours
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Rules
|
|
133
|
+
|
|
134
|
+
- Never plan a refactor as a single big-bang change — break into steps
|
|
135
|
+
- Each step must be independently verifiable
|
|
136
|
+
- Add tests BEFORE making behavior-preserving changes
|
|
137
|
+
- Consider backward compatibility during migration
|
|
138
|
+
- This planning skill does not implement the refactor — it plans it
|
|
139
|
+
|
|
140
|
+
## Quality Gates
|
|
141
|
+
|
|
142
|
+
- [ ] All dependents are identified (not just direct consumers)
|
|
143
|
+
- [ ] Each step has a validation and rollback strategy
|
|
144
|
+
- [ ] Risk is scored with justification
|
|
145
|
+
- [ ] Migration steps are ordered by dependency
|
|
146
|
+
|
|
147
|
+
## Cross-References
|
|
148
|
+
|
|
149
|
+
- Depends on: `graph-engine` (dependency data), `architecture-review-engine` (findings)
|
|
150
|
+
- Used by: `engineering-intelligence-skill` (for refactor-type requests)
|
|
151
|
+
- Triggers: `impact-analysis-engine` (when the refactor is implemented)
|
|
@@ -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
|
-
|
|
9
|
+
Determine the minimum sufficient test coverage for a change based on risk assessment and existing test patterns.
|
|
9
10
|
|
|
10
|
-
|
|
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
|
-
|
|
9
|
+
## Input
|
|
10
10
|
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
9
|
+
## Pipeline
|
|
10
10
|
|
|
11
|
-
|
|
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-
|
|
7
|
+
Use the `initialize-intelligence-skill` capability.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## What This Does
|
|
10
10
|
|
|
11
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
9
|
+
## Procedure
|
|
10
10
|
|
|
11
|
-
|
|
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
|
-
|
|
9
|
+
## Procedure
|
|
10
10
|
|
|
11
|
-
|
|
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
|