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,19 +1,126 @@
1
1
  ---
2
2
  name: context-sync-engine
3
3
  description: Maintains compact AI navigation context when modules, services, dependencies, runtime paths, or risk areas change. Use after significant implementation changes.
4
+ version: 3.0.0
4
5
  ---
5
6
 
6
7
  # Context Synchronization
7
8
 
8
- Maintain `.engineering-intelligence/context/`:
9
+ Maintain concise, navigational context maps optimized for AI agent use. Context maps help agents quickly find the right file, module, or service — not replace the knowledge base.
9
10
 
10
- - `module-map.md`
11
- - `service-map.md`
12
- - `runtime-map.md`
13
- - `critical-paths.md`
14
- - `dangerous-areas.md`
15
- - `dependency-map.md`
11
+ ## Inputs
16
12
 
17
- Keep context concise, navigational, and backed by current project paths.
13
+ - Impact report and graph updates
14
+ - Current `.engineering-intelligence/context/` documents
18
15
 
19
- Use the associated impact report and graph updates to revise only affected maps; do not regenerate unrelated navigation context.
16
+ ## Context Maps
17
+
18
+ Maintain these maps in `.engineering-intelligence/context/`:
19
+
20
+ ### `module-map.md` — Module Navigation
21
+
22
+ ```markdown
23
+ # Module Map
24
+
25
+ | Module | Path | Responsibility | Key Files |
26
+ |---|---|---|---|
27
+ | auth | src/auth/ | Authentication, JWT, RBAC | middleware.ts, jwt.ts |
28
+ | api | src/routes/ | REST endpoint handlers | users.ts, products.ts |
29
+ ```
30
+
31
+ ### `service-map.md` — Service Topology
32
+
33
+ ```markdown
34
+ # Service Map
35
+
36
+ | Service | Port | Protocol | Dependencies | Health Check |
37
+ |---|---|---|---|---|
38
+ | api-server | 3000 | HTTP | postgres, redis | /health |
39
+ | worker | — | — | rabbitmq, postgres | — |
40
+ ```
41
+
42
+ ### `runtime-map.md` — Request Flows
43
+
44
+ ```markdown
45
+ # Runtime Map
46
+
47
+ ## HTTP Request Flow
48
+ Entry → CORS → Auth → Rate Limit → Router → Handler → Response
49
+
50
+ ## Background Job Flow
51
+ Queue → Worker → Process → DB Write → Notify
52
+ ```
53
+
54
+ ### `critical-paths.md` — Revenue & Safety Critical Flows
55
+
56
+ ```markdown
57
+ # Critical Paths
58
+
59
+ | Flow | Entry Point | Risk | Last Verified |
60
+ |---|---|---|---|
61
+ | Payment processing | POST /api/checkout | High | CHG-005 |
62
+ | User registration | POST /api/auth/register | Medium | CHG-003 |
63
+ ```
64
+
65
+ ### `dangerous-areas.md` — Fragile & Risky Code
66
+
67
+ ```markdown
68
+ # Dangerous Areas
69
+
70
+ | Area | Path | Risk | Reason |
71
+ |---|---|---|---|
72
+ | Legacy auth | src/auth/legacy.ts | High | No tests, race conditions |
73
+ | Payment retry | src/payments/retry.ts | High | Complex state machine |
74
+ ```
75
+
76
+ ### `dependency-map.md` — External Dependencies
77
+
78
+ ```markdown
79
+ # Dependency Map
80
+
81
+ | Dependency | Version | Consumers | Risk |
82
+ |---|---|---|---|
83
+ | express | 4.18.x | api-server | Low — stable |
84
+ | stripe | 12.x | payments module | Medium — breaking changes |
85
+ ```
86
+
87
+ ## Procedure
88
+
89
+ 1. **Check Impact** — Review the impact report and graph updates. Identify which context maps are affected.
90
+
91
+ 2. **Update Affected Maps** — For each affected map:
92
+ - Update specific entries, not the entire map
93
+ - Add new entries for new modules/services/paths
94
+ - Remove entries for deleted modules/services
95
+ - Update paths and descriptions for renamed elements
96
+
97
+ 3. **Preserve Conciseness** — Each map should be:
98
+ - Under 150 lines
99
+ - Table-formatted where possible
100
+ - Navigational (paths and quick descriptions), not explanatory
101
+ - Optimized for AI agent context windows
102
+
103
+ 4. **Verify Accuracy** — Cross-check updated maps against:
104
+ - Current `.engineering-intelligence/graph/` data
105
+ - Actual file system paths (do they still exist?)
106
+
107
+ ## Rules
108
+
109
+ - Keep context concise and navigational — not a knowledge-base duplicate
110
+ - Use tables over prose wherever possible
111
+ - Update only affected maps from the impact report
112
+ - Do not regenerate unrelated context
113
+ - Maps must reflect actual file system state (no phantom paths)
114
+
115
+ ## Quality Gates
116
+
117
+ - [ ] Each map is under 150 lines
118
+ - [ ] Updated entries reference real, existing paths
119
+ - [ ] Only impact-affected maps were modified
120
+ - [ ] Table format used where appropriate
121
+
122
+ ## Cross-References
123
+
124
+ - Depends on: `impact-analysis-engine` (identifies affected maps), `graph-engine` (provides topology data)
125
+ - Used by: `incremental-sync-engine`, `engineering-intelligence-skill`
126
+ - Consumed by: All agents (for navigation)
@@ -1,16 +1,182 @@
1
1
  ---
2
2
  name: deep-project-knowledge-extractor
3
3
  description: Analyzes an existing software repository and produces evidence-based architecture, runtime, API, infrastructure, risk, and onboarding documentation. Use when creating or refreshing the project knowledge base.
4
+ version: 3.0.0
4
5
  ---
5
6
 
6
7
  # Deep Project Knowledge Extractor
7
8
 
8
- Inspect package/workspace manifests, source entrypoints, dependency boundaries, routes, schemas, middleware, tests, CI and infrastructure. Generate the structured documents in `knowledge-base/`.
9
+ Produce comprehensive, evidence-backed project documentation by systematic repository analysis. Every material claim must cite a source file path. Silence is never acceptable use `**Not detected**` for absent features.
9
10
 
10
- Every material statement must be supported by repository evidence. Cite relevant paths in the documents. State `Not detected` or `Unclear from repository evidence` where appropriate.
11
+ ## Inputs
11
12
 
12
- Required documents:
13
+ - Repository root path
14
+ - Optional: scope constraints (specific package, service, or directory)
13
15
 
14
- - `00-project-overview.md` through `14-glossary.md`
16
+ ## Discovery Checklist
15
17
 
16
- Cover repository structure, architecture, runtime flow, APIs, persistence, authentication, frontend, backend, infrastructure, integrations, complex areas, technical debt, onboarding, and glossary.
18
+ Scan the repository systematically for each category:
19
+
20
+ | Category | What to Look For |
21
+ |---|---|
22
+ | **Package Management** | `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, `pom.xml`, workspace configs |
23
+ | **Build System** | `Makefile`, `webpack.config.*`, `vite.config.*`, `tsconfig.json`, `build.gradle` |
24
+ | **Entrypoints** | `main.*`, `index.*`, `app.*`, `server.*`, bin scripts |
25
+ | **Routing** | Express/Koa/Fastify routes, Next.js pages/app dirs, API gateways |
26
+ | **Database** | Migration dirs, schema files, ORM configs, seed scripts |
27
+ | **Auth** | Passport/Auth0/JWT configs, middleware, RBAC definitions |
28
+ | **CI/CD** | `.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`, `Dockerfile` |
29
+ | **Infrastructure** | `docker-compose.yml`, `terraform/`, `k8s/`, `serverless.yml` |
30
+ | **Tests** | `test/`, `__tests__/`, `spec/`, `*.test.*`, `*.spec.*`, test configs |
31
+ | **Environment** | `.env.example`, `.env.sample`, env validation schemas |
32
+ | **Documentation** | `README.md`, `docs/`, `CHANGELOG.md`, `CONTRIBUTING.md` |
33
+
34
+ ## Output Specification
35
+
36
+ Generate each document in `knowledge-base/` with this structure:
37
+
38
+ ```markdown
39
+ # <Document Title>
40
+
41
+ <One-paragraph executive summary>
42
+
43
+ ## <Section>
44
+
45
+ <Content with inline evidence citations>
46
+
47
+ (evidence: path/to/file:L42-L58)
48
+
49
+ ## Unknowns & Uncertainties
50
+
51
+ - <what is unclear and why>
52
+ ```
53
+
54
+ ### Required Documents
55
+
56
+ #### `00-project-overview.md`
57
+ - Project name, description, primary purpose
58
+ - Technology stack (languages, frameworks, major libraries)
59
+ - Repository type (monorepo, polyrepo, single-package)
60
+ - High-level architecture summary (1 paragraph)
61
+ - Key entry points and how to run the project
62
+
63
+ #### `01-repository-structure.md`
64
+ - Annotated directory tree (top 2-3 levels)
65
+ - Package/workspace boundaries
66
+ - Build output directories
67
+ - Generated vs authored code distinction
68
+
69
+ #### `02-architecture.md`
70
+ - Architectural pattern (monolith, microservices, serverless, modular monolith)
71
+ - Layer definitions (presentation, business, data, infrastructure)
72
+ - Module/package boundaries and their responsibilities
73
+ - Communication patterns (HTTP, gRPC, events, queues)
74
+ - Dependency direction rules
75
+
76
+ #### `03-runtime-flow.md`
77
+ - Application startup sequence
78
+ - Request lifecycle (from entry to response)
79
+ - Background job / worker flows
80
+ - Shutdown / graceful termination
81
+ - Async processing patterns
82
+
83
+ #### `04-api-documentation.md`
84
+ - REST endpoints: method, path, auth, request/response shapes
85
+ - GraphQL schemas and resolvers
86
+ - WebSocket channels
87
+ - RPC interfaces
88
+ - API versioning strategy
89
+
90
+ #### `05-database.md`
91
+ - Database engine(s) and connection configuration
92
+ - Schema overview (tables/collections, key relationships)
93
+ - Migration strategy and tooling
94
+ - Caching layers (Redis, Memcached, in-memory)
95
+ - Data access patterns (repository, active record, query builder)
96
+
97
+ #### `06-authentication.md`
98
+ - Auth provider and strategy (JWT, session, OAuth, SAML)
99
+ - Login/registration flows
100
+ - Token lifecycle and refresh
101
+ - Role/permission model (RBAC, ABAC)
102
+ - Protected route/middleware patterns
103
+
104
+ #### `07-frontend.md`
105
+ - UI framework and version
106
+ - Routing strategy (client-side, SSR, SSG)
107
+ - State management approach
108
+ - Component architecture and patterns
109
+ - Styling approach (CSS modules, Tailwind, styled-components)
110
+ - Build and bundling pipeline
111
+
112
+ #### `08-backend.md`
113
+ - Server framework and version
114
+ - Middleware stack (ordered list)
115
+ - Service/controller pattern
116
+ - Error handling strategy
117
+ - Logging and observability
118
+
119
+ #### `09-infrastructure.md`
120
+ - Hosting/cloud provider
121
+ - Container orchestration
122
+ - CI/CD pipeline stages
123
+ - Environment management (dev, staging, prod)
124
+ - Secrets management
125
+ - Monitoring and alerting
126
+
127
+ #### `10-integrations.md`
128
+ - Third-party API integrations
129
+ - Payment processors, email services, SMS
130
+ - Analytics and tracking
131
+ - External data sources
132
+ - Webhook consumers/producers
133
+
134
+ #### `11-complex-areas.md`
135
+ - High cyclomatic complexity modules
136
+ - Business logic with many edge cases
137
+ - Code with subtle race conditions or timing dependencies
138
+ - Areas with heavy tech debt affecting reliability
139
+
140
+ #### `12-technical-debt.md`
141
+ - Deprecated patterns still in use
142
+ - Missing test coverage in critical paths
143
+ - Known performance bottlenecks
144
+ - Planned but incomplete migrations
145
+ - Security improvements needed
146
+
147
+ #### `13-onboarding.md`
148
+ - Prerequisites (tools, accounts, access)
149
+ - Setup steps (clone, install, configure, run)
150
+ - Development workflow (branch, test, PR)
151
+ - Common tasks and commands
152
+ - Troubleshooting common issues
153
+
154
+ #### `14-glossary.md`
155
+ - Domain-specific terms with definitions
156
+ - Abbreviations and acronyms
157
+ - Naming conventions used in the codebase
158
+
159
+ #### `15-validation-report.md`
160
+ - Generated by `knowledge-base-validator` after extraction
161
+
162
+ ## Evidence Rules
163
+
164
+ 1. Every architectural claim must cite at least one source file
165
+ 2. Use the format: `(evidence: relative/path/to/file:L<line>)` or `(evidence: relative/path/to/file)`
166
+ 3. When evidence is indirect (inferred from patterns), use: `(inferred from: path/to/file)`
167
+ 4. When no evidence exists: `**Not detected** — no relevant configuration or code found`
168
+ 5. When evidence is ambiguous: `**Unclear from evidence** — [explanation of ambiguity]`
169
+
170
+ ## Quality Gates
171
+
172
+ - [ ] All 16 documents generated (00 through 15)
173
+ - [ ] Every document has an executive summary paragraph
174
+ - [ ] Every material claim has an evidence citation
175
+ - [ ] Absent features use `**Not detected**` — not silence
176
+ - [ ] Ambiguous areas use `**Unclear from evidence**`
177
+ - [ ] No invented implementation details
178
+
179
+ ## Cross-References
180
+
181
+ - Used by: `initialize-intelligence-skill`
182
+ - Feeds into: `knowledge-base-validator`, all sync engines
@@ -1,18 +1,154 @@
1
1
  ---
2
2
  name: engineering-change-review
3
- description: Reviews changed implementation, tests, impact analysis, graph consistency, and synchronized project intelligence without applying fixes. Use after engineering changes or before completion.
3
+ description: Reviews engineering changes for correctness, test coverage, architecture alignment, graph consistency, and documentation accuracy. Use after implementation to validate quality before completion.
4
+ version: 3.0.0
4
5
  ---
5
6
 
6
7
  # Engineering Change Review
7
8
 
8
- Review changed code and tests against the request, impact report, validation evidence, graph artifacts, and synchronized intelligence.
9
+ Review completed engineering work for correctness, completeness, and alignment with project standards. Produce a structured review report with severity-ordered findings.
9
10
 
10
- Write `.engineering-intelligence/reports/REV-XXX-<slug>.md` with:
11
+ ## Inputs
11
12
 
12
- - findings first, ordered by severity
13
- - code and evidence paths
14
- - regression, validation, graph-staleness, and documentation-staleness risks
15
- - test gaps and unresolved questions
16
- - a short reviewed-change summary only after findings
13
+ - Implementation diff or changed scope
14
+ - Impact report (`.engineering-intelligence/reports/IMP-XXX-*.md`)
15
+ - Test and validation evidence
16
+ - Updated graph and intelligence artifacts
17
17
 
18
- This review capability may write its report. It must not modify product code or auto-fix findings.
18
+ ## Review Dimensions
19
+
20
+ ### 1. Implementation Correctness
21
+
22
+ | Check | What to Verify |
23
+ |---|---|
24
+ | Request fulfillment | Does the implementation address the original request? |
25
+ | Logic correctness | Are algorithms and business logic correct? |
26
+ | Edge cases | Are boundary conditions handled? |
27
+ | Error handling | Are errors caught, logged, and reported appropriately? |
28
+ | Resource management | Are connections, files, and memory properly managed? |
29
+ | Concurrency safety | Are shared resources properly synchronized? |
30
+
31
+ ### 2. Test Coverage
32
+
33
+ | Check | What to Verify |
34
+ |---|---|
35
+ | Happy path | Is the expected behavior tested? |
36
+ | Error path | Are error scenarios tested? |
37
+ | Regression | Does a test prevent the original issue from recurring (bugfix)? |
38
+ | Boundary | Are edge cases and limits tested? |
39
+ | Execution | Were tests actually run? (Not just written) |
40
+ | Results | Did all tests pass? Are failures explained? |
41
+
42
+ ### 3. Architecture Alignment
43
+
44
+ | Check | What to Verify |
45
+ |---|---|
46
+ | Boundary respect | Does the change respect module/service boundaries? |
47
+ | Pattern compliance | Does it follow established patterns from memory? |
48
+ | Dependency direction | Are dependencies flowing in the correct direction? |
49
+ | Abstraction level | Is the code at the appropriate abstraction level? |
50
+
51
+ ### 4. Graph Consistency
52
+
53
+ | Check | What to Verify |
54
+ |---|---|
55
+ | Node updates | Are new modules/services reflected in graphs? |
56
+ | Edge updates | Are new dependencies/relationships reflected? |
57
+ | Stale entries | Were removed elements cleaned from graphs? |
58
+ | Map alignment | Does architecture-map.md reflect JSON graph changes? |
59
+
60
+ ### 5. Documentation Accuracy
61
+
62
+ | Check | What to Verify |
63
+ |---|---|
64
+ | Knowledge sync | Were affected knowledge docs updated? |
65
+ | Memory sync | Were durable decisions captured if needed? |
66
+ | Context sync | Were navigation maps updated? |
67
+ | Change record | Does the CHG record accurately reflect the work? |
68
+ | Impact report | Was the impact report referenced correctly? |
69
+
70
+ ## Finding Severity Scale
71
+
72
+ | Severity | Symbol | Meaning | Action Required |
73
+ |---|---|---|---|
74
+ | Blocker | 🔴 | Breaks functionality or introduces security risk | Must fix before completion |
75
+ | Major | 🟠 | Significant issue but not immediately breaking | Should fix before completion |
76
+ | Minor | 🟡 | Code quality or style issue | Fix when convenient |
77
+ | Suggestion | 🔵 | Optional improvement | Consider for future |
78
+ | Positive | 🟢 | Good practice or improvement observed | No action needed |
79
+
80
+ ## Procedure
81
+
82
+ 1. **Read Context** — Load the impact report, implementation diff, and test results.
83
+ 2. **Review Each Dimension** — Walk through all five review dimensions above.
84
+ 3. **Score Findings** — Assign severity to each finding.
85
+ 4. **Check Intelligence** — Verify graph, knowledge, memory, and context were appropriately synced.
86
+ 5. **Write Report** — Generate the review report.
87
+
88
+ ## Output Format
89
+
90
+ Write `.engineering-intelligence/reports/REV-XXX-<slug>.md`:
91
+
92
+ ```markdown
93
+ # REV-XXX: <summary>
94
+
95
+ ## Meta
96
+ - Date: <ISO timestamp>
97
+ - Related: IMP-XXX, CHG-XXX
98
+ - Scope: <what was reviewed>
99
+
100
+ ## Summary
101
+ - Total findings: X
102
+ - 🔴 Blocker: Y | 🟠 Major: Z | 🟡 Minor: W | 🔵 Suggestion: V
103
+
104
+ ## Verdict
105
+ - [ ] ✅ Approved — No blocking issues
106
+ - [ ] ⚠️ Approved with findings — Non-blocking issues noted
107
+ - [ ] ❌ Changes required — Blocking issues must be addressed
108
+
109
+ ## Findings
110
+
111
+ ### 🔴 [Finding Title]
112
+ - **Dimension**: Implementation / Testing / Architecture / Graph / Documentation
113
+ - **Location**: <file:line or artifact path>
114
+ - **Description**: <what was found>
115
+ - **Evidence**: <code reference or comparison>
116
+ - **Recommendation**: <how to fix>
117
+
118
+ ### 🟢 [Positive Finding]
119
+ - **Description**: <good practice observed>
120
+
121
+ ## Test Gaps
122
+ - <untested areas that should be tested>
123
+
124
+ ## Intelligence Sync Status
125
+ | Artifact | Status | Notes |
126
+ |---|---|---|
127
+ | knowledge-base/ | ✅ Synced | API docs updated |
128
+ | graph/ | ⚠️ Partial | Missing new service node |
129
+
130
+ ## Stale Intelligence Risks
131
+ - <areas where docs may drift from code>
132
+ ```
133
+
134
+ ## Rules
135
+
136
+ - Review is read-only — do not apply fixes during a review-only workflow
137
+ - Be honest about gaps and risks — sugar-coating helps nobody
138
+ - Include positive findings alongside issues — balanced review
139
+ - All findings must cite specific evidence (file paths, code references)
140
+ - If tests were not actually run, flag it as a major finding
141
+
142
+ ## Quality Gates
143
+
144
+ - [ ] All five review dimensions were evaluated
145
+ - [ ] Each finding has severity, location, and evidence
146
+ - [ ] Test execution was verified (not assumed)
147
+ - [ ] Intelligence sync status was checked
148
+ - [ ] Report includes verdict (approved/changes required)
149
+
150
+ ## Cross-References
151
+
152
+ - Depends on: `change-detection-engine` (identifies what to review)
153
+ - Used by: `engineering-intelligence-skill` (high-risk review gate), `review-engineering-change` workflow
154
+ - Reads: Impact reports, change records, graph artifacts
@@ -0,0 +1,168 @@
1
+ ---
2
+ name: engineering-intelligence-skill
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
+ version: 3.0.0
5
+ ---
6
+
7
+ # Engineering Intelligence Implementation
8
+
9
+ The core implementation skill for engineering work. Use after project intelligence has been initialized.
10
+
11
+ ## Inputs
12
+
13
+ - User request describing the desired change
14
+ - Repository with initialized intelligence (`knowledge-base/`, `.engineering-intelligence/`)
15
+
16
+ ## Request Classification
17
+
18
+ Classify the incoming request before starting:
19
+
20
+ | Type | Description | Risk Level |
21
+ |---|---|---|
22
+ | `feature` | New user-facing functionality | Medium–High |
23
+ | `bugfix` | Correction of incorrect behavior | Low–Medium |
24
+ | `update` | Dependency, config, or version updates | Low–Medium |
25
+ | `refactor` | Structural improvement without behavior change | Medium |
26
+ | `architecture` | Boundary, layer, or pattern changes | High |
27
+ | `infrastructure` | CI, deployment, environment changes | Medium–High |
28
+ | `security` | Auth, permissions, vulnerability fixes | High |
29
+ | `documentation` | Knowledge-only changes (no product code) | Low |
30
+
31
+ ## Procedure
32
+
33
+ ### 1. Pre-Flight: Read Intelligence
34
+
35
+ Read these artifacts and identify relevant context:
36
+ - `knowledge-base/` — architecture, APIs, runtime flow relevant to the change
37
+ - `.engineering-intelligence/memory/` — decisions, constraints, patterns that apply
38
+ - `.engineering-intelligence/context/` — module map, critical paths, dangerous areas near the change
39
+ - `.engineering-intelligence/graph/` — dependency and service relationships
40
+
41
+ **If intelligence is missing or stale**: Run `initialize-intelligence-skill` first.
42
+
43
+ ### 2. Impact Analysis: Write Report
44
+
45
+ Before any code edit, write `.engineering-intelligence/reports/IMP-XXX-<summary>.md`:
46
+
47
+ ```markdown
48
+ # IMP-XXX: <summary>
49
+
50
+ ## Classification
51
+ - Type: <feature|bugfix|update|refactor|architecture|infrastructure|security>
52
+ - Risk: <low|medium|high|critical>
53
+ - Scope: <files and modules affected>
54
+
55
+ ## Analysis
56
+ - Mode: <proposal|diff>
57
+ - Graph inputs consulted: <list>
58
+ - Directly affected: <files, modules, services>
59
+ - Indirectly affected: <downstream consumers, dependent services>
60
+ - Risk factors: <breaking changes, data migration, auth impact>
61
+
62
+ ## Validation Requirements
63
+ - <test types needed>
64
+ - <manual verification needed>
65
+
66
+ ## Intelligence Artifacts Affected
67
+ - <knowledge docs, memory entries, context maps, graph nodes>
68
+
69
+ ## Evidence
70
+ - <file paths supporting each claim>
71
+
72
+ ## Unknowns
73
+ - <areas where impact is uncertain>
74
+ ```
75
+
76
+ ### 3. Implement the Change
77
+
78
+ - Edit only the files necessary for the request
79
+ - Follow existing coding patterns from `.engineering-intelligence/memory/coding-patterns.md`
80
+ - Respect architectural boundaries from `.engineering-intelligence/memory/architecture-decisions.md`
81
+ - Consult `dangerous-areas.md` before modifying flagged code
82
+
83
+ ### 4. Add/Update Tests
84
+
85
+ - Add tests proportional to the change risk level
86
+ - For `bugfix`: add a regression test reproducing the original issue
87
+ - For `feature`: add unit tests and integration tests for the new behavior
88
+ - For `architecture`/`security`: add boundary and negative-path tests
89
+ - Run the project's test suite and record actual results
90
+
91
+ ### 5. Validate
92
+
93
+ - Run linters, type checks, and test suites available in the project
94
+ - **Never claim validation passed unless it actually ran and passed**
95
+ - Record partial or failed validation honestly
96
+
97
+ ### 6. Incremental Sync
98
+
99
+ Use `incremental-sync-engine` to update only affected artifacts:
100
+ - Knowledge docs reflecting changed behavior
101
+ - Memory entries if decisions/patterns changed
102
+ - Context maps if module/service topology changed
103
+ - Graph nodes/edges if dependencies or services changed
104
+ - Event guidance if API/schema/auth contracts changed
105
+
106
+ ### 7. Record Change
107
+
108
+ Create `.changes/CHG-XXX-<summary>.md`:
109
+
110
+ ```markdown
111
+ # CHG-XXX: <summary>
112
+
113
+ ## Request
114
+ <original user request>
115
+
116
+ ## Classification
117
+ - Type: <type> | Risk: <level>
118
+
119
+ ## Implementation Summary
120
+ <what was changed and why>
121
+
122
+ ## Files Changed
123
+ - <path> — <description of change>
124
+
125
+ ## Tests
126
+ - <tests added/modified>
127
+ - <test results: passed/failed/skipped>
128
+
129
+ ## Related Reports
130
+ - IMP-XXX: <link to impact report>
131
+ - REV-XXX: <link to review report, if applicable>
132
+
133
+ ## Synchronized Artifacts
134
+ - <list of updated intelligence artifacts>
135
+
136
+ ## Unresolved Risks
137
+ - <any remaining concerns>
138
+ ```
139
+
140
+ ### 8. High-Risk Review Gate
141
+
142
+ For changes classified as `high` or `critical` risk:
143
+ - Run `engineering-change-review` before final reporting
144
+ - Address any blocking findings before marking complete
145
+
146
+ ### 9. Report
147
+
148
+ Summarize to the user:
149
+ - Code changes made (files, lines)
150
+ - Tests run and results
151
+ - Affected systems and services
152
+ - Synchronized intelligence artifacts
153
+ - Unresolved risks or follow-ups
154
+
155
+ ## Quality Gates
156
+
157
+ - [ ] Impact report written before any code edit
158
+ - [ ] All changed behavior has corresponding test coverage
159
+ - [ ] Validation was actually executed (not just claimed)
160
+ - [ ] Only affected intelligence artifacts were updated
161
+ - [ ] Change record references the correct impact report
162
+ - [ ] High-risk changes went through review gate
163
+
164
+ ## Cross-References
165
+
166
+ - Depends on: `initialize-intelligence-skill` (prerequisite), `change-detection-engine`, `impact-analysis-engine`, `graph-engine`
167
+ - Uses during execution: `testing-intelligence-engine`, `incremental-sync-engine`, `change-history-engine`
168
+ - Optional: `engineering-change-review` (for high-risk), `refactoring-planner` (for refactors)