engineering-intelligence 0.8.1 → 1.1.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 (60) hide show
  1. package/README.md +23 -2
  2. package/dist/adapters/index.d.ts.map +1 -1
  3. package/dist/adapters/index.js +55 -11
  4. package/dist/adapters/index.js.map +1 -1
  5. package/dist/cli/index.js +20 -2
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/installer/index.d.ts.map +1 -1
  8. package/dist/installer/index.js +2 -10
  9. package/dist/installer/index.js.map +1 -1
  10. package/dist/manifest/index.d.ts +1 -1
  11. package/dist/manifest/index.js +1 -1
  12. package/dist/templates.d.ts +4 -3
  13. package/dist/templates.d.ts.map +1 -1
  14. package/dist/templates.js +59 -1
  15. package/dist/templates.js.map +1 -1
  16. package/dist/validation/index.d.ts.map +1 -1
  17. package/dist/validation/index.js +4 -12
  18. package/dist/validation/index.js.map +1 -1
  19. package/dist/visualizer/index.d.ts.map +1 -1
  20. package/dist/visualizer/index.js +100 -5
  21. package/dist/visualizer/index.js.map +1 -1
  22. package/package.json +1 -1
  23. package/templates/canonical/agents/adversary.md +19 -0
  24. package/templates/canonical/agents/compliance-auditor.md +20 -0
  25. package/templates/canonical/agents/database-administrator.md +21 -0
  26. package/templates/canonical/agents/documentation-writer.md +19 -0
  27. package/templates/canonical/agents/engineering-orchestrator.md +49 -8
  28. package/templates/canonical/agents/performance-analyst.md +19 -0
  29. package/templates/canonical/agents/product-analyst.md +5 -1
  30. package/templates/canonical/agents/release-engineer.md +20 -0
  31. package/templates/canonical/agents/security-officer.md +21 -0
  32. package/templates/canonical/agents/site-reliability-engineer.md +19 -0
  33. package/templates/canonical/agents/system-architect.md +27 -0
  34. package/templates/canonical/agents/test-engineer.md +20 -0
  35. package/templates/canonical/rules/engineering-intelligence.md +45 -4
  36. package/templates/canonical/skills/aidlc-lifecycle-engine/SKILL.md +141 -0
  37. package/templates/canonical/skills/codebase-discovery-engine/SKILL.md +428 -0
  38. package/templates/canonical/skills/convention-detector/SKILL.md +199 -0
  39. package/templates/canonical/skills/debugging-engine/SKILL.md +189 -0
  40. package/templates/canonical/skills/engineering-intelligence-skill/SKILL.md +30 -1
  41. package/templates/canonical/skills/environmental-backpressure-engine/SKILL.md +50 -0
  42. package/templates/canonical/skills/git-intelligence-engine/SKILL.md +146 -0
  43. package/templates/canonical/skills/graph-engine/SKILL.md +30 -5
  44. package/templates/canonical/skills/greenfield-architect/SKILL.md +287 -0
  45. package/templates/canonical/skills/impact-analysis-engine/SKILL.md +12 -4
  46. package/templates/canonical/skills/incremental-sync-engine/SKILL.md +17 -0
  47. package/templates/canonical/skills/mcp-security-governor/SKILL.md +51 -0
  48. package/templates/canonical/skills/nfr-adr-governor/SKILL.md +83 -0
  49. package/templates/canonical/skills/ongoing-learning-engine/SKILL.md +175 -0
  50. package/templates/canonical/skills/operations-readiness-engine/SKILL.md +54 -0
  51. package/templates/canonical/skills/performance-analysis-engine/SKILL.md +156 -0
  52. package/templates/canonical/skills/pr-intelligence-engine/SKILL.md +127 -0
  53. package/templates/canonical/skills/requirement-scoper/SKILL.md +17 -3
  54. package/templates/canonical/skills/security-audit-engine/SKILL.md +165 -0
  55. package/templates/canonical/skills/staleness-detector/SKILL.md +185 -0
  56. package/templates/canonical/workflows/create-project.md +63 -0
  57. package/templates/canonical/workflows/discover-codebase.md +60 -0
  58. package/templates/canonical/workflows/engineering-intelligence.md +12 -8
  59. package/templates/canonical/workflows/initialize-engineering-intelligence.md +3 -1
  60. package/templates/canonical/workflows/scope-requirement.md +5 -4
@@ -68,6 +68,8 @@ Each JSON graph uses this envelope:
68
68
  | `devDependency` | Development-only dependency |
69
69
  | `peerDependency` | Peer/optional dependency |
70
70
  | `configures` | Configuration dependency |
71
+ | `implicit-dependency` | Shared database tables, shared config |
72
+ | `event-coupling` | Event-driven coupling |
71
73
 
72
74
  ### 2. `service-graph.json` — Service Communication Topology
73
75
 
@@ -87,6 +89,8 @@ Each JSON graph uses this envelope:
87
89
  | `subscribes` | Event/message consumption |
88
90
  | `reads` | Data store read access |
89
91
  | `writes` | Data store write access |
92
+ | `shares-data` | Shared database/cache |
93
+ | `feature-flag` | Feature-flag-controlled behavior |
90
94
 
91
95
  ### 3. `runtime-graph.json` — Runtime Call Flows
92
96
 
@@ -123,7 +127,25 @@ Each JSON graph uses this envelope:
123
127
  | `on-failure` | Error/failure path |
124
128
  | `requires` | Prerequisite relationship |
125
129
 
126
- ### 5. `architecture-map.md` — Mermaid Visualization
130
+ ### 5. `data-flow-graph.json` — Data Transformation Graph
131
+
132
+ | Node Kind | Description |
133
+ |---|---|
134
+ | `source` | Data origin |
135
+ | `transform` | Processing step |
136
+ | `store` | Persistence |
137
+ | `sink` | Data output/consumer |
138
+ | `validator` | Validation step |
139
+
140
+ | Edge Relation | Description |
141
+ |---|---|
142
+ | `feeds` | Data feed |
143
+ | `transforms` | Data transformation |
144
+ | `validates` | Data validation |
145
+ | `persists` | Data persistence |
146
+ | `emits` | Data emission/output |
147
+
148
+ ### 6. `architecture-map.md` — Mermaid Visualization
127
149
 
128
150
  Derive Mermaid diagrams from the JSON graphs. Include:
129
151
 
@@ -131,17 +153,19 @@ Derive Mermaid diagrams from the JSON graphs. Include:
131
153
  - **Module Dependencies** — Package/module dependency flow (from dependency-graph)
132
154
  - **Request Flow** — Primary request lifecycle (from runtime-graph)
133
155
  - **Key Business Flows** — Critical business processes (from business-flow-graph)
156
+ - **Data Flow** — Data transformation pipelines (from data-flow-graph)
134
157
 
135
158
  ## Procedure
136
159
 
137
160
  ### Full Mode (initialization or remapping)
138
161
 
139
162
  1. Scan all package manifests, imports, route definitions, service configs, and infrastructure files
140
- 2. Build all four graphs from scratch
163
+ 2. Build all five graphs from scratch
141
164
  3. Assign `verified` confidence to edges backed by explicit code evidence
142
165
  4. Assign `inferred` confidence to edges derived from patterns or naming conventions
143
- 5. Mark unresolvable relationships as `unknown` and add to `unknowns` array
144
- 6. Generate Mermaid diagrams in `architecture-map.md`
166
+ 5. Integrate git change coupling data from `git-intelligence-engine` as `inferred` edges files that frequently change together suggest hidden dependencies
167
+ 6. Mark unresolvable relationships as `unknown` and add to `unknowns` array
168
+ 7. Generate Mermaid diagrams in `architecture-map.md`
145
169
 
146
170
  ### Incremental Mode (post-change update)
147
171
 
@@ -163,7 +187,7 @@ Derive Mermaid diagrams from the JSON graphs. Include:
163
187
 
164
188
  ## Quality Gates
165
189
 
166
- - [ ] All four JSON graphs validate against the schema above
190
+ - [ ] All five JSON graphs (`dependency-graph.json`, `service-graph.json`, `runtime-graph.json`, `business-flow-graph.json`, `data-flow-graph.json`) validate against the schema above
167
191
  - [ ] Every `verified` edge has at least one evidence path
168
192
  - [ ] No `unknown` relationships are left out of the `unknowns` array
169
193
  - [ ] `architecture-map.md` Mermaid diagrams are syntactically valid
@@ -174,5 +198,6 @@ Derive Mermaid diagrams from the JSON graphs. Include:
174
198
  - Used by: `initialize-intelligence-skill`, `impact-analysis-engine`, `incremental-sync-engine`
175
199
  - Supports: `map-architecture` workflow, `analyze-impact` workflow
176
200
  - Feeds context to: `context-sync-engine`
201
+ - Integrates data from: `git-intelligence-engine`
177
202
 
178
203
  This capability may write intelligence artifacts. It must not modify product code.
@@ -0,0 +1,287 @@
1
+ ---
2
+ name: greenfield-architect
3
+ description: Interview-based skill for new greenfield projects. Conducts a structured requirements interview (7-12 questions), generates architecture recommendations with tech stack selection, and scaffolds a complete project with pre-filled knowledge base, memory, context, configuration, CI/CD, and environment setup.
4
+ version: 3.0.0
5
+ ---
6
+
7
+ # Greenfield Architect
8
+
9
+ Guide a developer from zero to a fully scaffolded, opinionated project with engineering intelligence pre-configured. This skill operates in three phases: requirements interview, architecture generation, and scaffold output.
10
+
11
+ ## Inputs
12
+
13
+ - Project name
14
+ - Optional: partial requirements (if the user already knows some answers)
15
+ - Optional: preferred tech stack constraints (e.g., "must use Python", "no React")
16
+
17
+ ## Phase 1: Requirements Interview (7–12 Questions)
18
+
19
+ Ask questions in this order. Skip questions the user has already answered. Present sensible defaults where possible so the user can simply confirm.
20
+
21
+ ### 1.1 Core Questions (Always Ask)
22
+
23
+ | # | Question | Why It Matters | Default |
24
+ |---|---|---|---|
25
+ | 1 | **What are you building?** Describe the product in 2-3 sentences. | Determines domain, complexity, core features | — |
26
+ | 2 | **Who are the users?** (internal team, B2B, B2C, developers/API consumers) | Determines auth complexity, UI needs, scale expectations | B2C web app |
27
+ | 3 | **What are the 3-5 core features?** List the must-have capabilities for v1. | Scopes the architecture, identifies bounded contexts | — |
28
+ | 4 | **What scale do you expect?** (hobby, startup MVP, growth stage, enterprise) | Determines infrastructure complexity, database choice, caching needs | Startup MVP |
29
+ | 5 | **Where will this run?** (Vercel, AWS, GCP, Azure, self-hosted, edge) | Determines deployment strategy, serverless vs containers | Vercel |
30
+ | 6 | **Solo developer or team?** How many developers, what experience levels? | Determines convention strictness, CI complexity, review process | Solo |
31
+ | 7 | **Any hard tech constraints?** (must use language X, must integrate with Y, must comply with Z) | Constrains tech stack selection | None |
32
+
33
+ ### 1.2 Conditional Questions (Ask Based on Answers)
34
+
35
+ | # | Condition | Question | Default |
36
+ |---|---|---|---|
37
+ | 8 | Users = B2C or B2B | **Auth requirements?** (email/password, social login, SSO, MFA) | Email/password + social |
38
+ | 9 | Scale ≥ growth | **Real-time features?** (WebSockets, SSE, live updates) | No |
39
+ | 10 | Features include payments | **Payment provider preference?** (Stripe, PayPal, custom) | Stripe |
40
+ | 11 | Team > 1 | **Monorepo or polyrepo?** | Monorepo if > 2 services |
41
+ | 12 | Features include content | **CMS needs?** (headless CMS, built-in, markdown) | Markdown/MDX |
42
+
43
+ ### Interview Rules
44
+
45
+ - Present each question with the default value: "I'd suggest X because Y — does that work?"
46
+ - Allow batch answers: the user can answer multiple questions at once
47
+ - If the user provides a project brief, extract answers from it before asking remaining questions
48
+ - Never ask more than 12 questions total
49
+ - Confirm the full requirements summary before proceeding to Phase 2
50
+
51
+ ## Phase 2: Architecture Generation
52
+
53
+ Based on interview answers, generate architecture recommendations.
54
+
55
+ ### 2.1 Tech Stack Selection
56
+
57
+ Use this decision matrix to recommend a tech stack:
58
+
59
+ | Requirement | Next.js | Vite+React | Solid.js | Express | FastAPI | Django | Spring Boot |
60
+ |---|---|---|---|---|---|---|---|
61
+ | SSR/SSG needed | ✅ Best | ❌ SPA only | ⚠️ SolidStart | N/A | N/A | ✅ Templates | N/A |
62
+ | API-only backend | ❌ Overkill | N/A | N/A | ✅ Best | ✅ Best | ✅ Good | ✅ Best |
63
+ | Full-stack | ✅ Best | ⚠️ Need backend | ⚠️ Emerging | ⚠️ Need frontend | ⚠️ Need frontend | ✅ Good | ⚠️ Need frontend |
64
+ | Real-time | ⚠️ Via API routes | ⚠️ Need backend | ⚠️ Need backend | ✅ Socket.io | ✅ WebSockets | ⚠️ Channels | ✅ WebSocket |
65
+ | Enterprise/Java team | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ Best |
66
+ | Python team | ❌ | ❌ | ❌ | ❌ | ✅ Best | ✅ Best | ❌ |
67
+ | Rapid prototyping | ✅ Good | ✅ Good | ⚠️ Smaller ecosystem | ✅ Good | ✅ Best | ✅ Good | ❌ Slower |
68
+ | Edge deployment | ✅ Best | ✅ Good | ✅ Good | ⚠️ Node only | ❌ | ❌ | ❌ |
69
+
70
+ Present the recommendation with reasoning: "I recommend X because [reasons based on your answers]."
71
+
72
+ ### 2.2 Database Selection
73
+
74
+ | Requirement | PostgreSQL | MySQL | MongoDB | SQLite | DynamoDB |
75
+ |---|---|---|---|---|---|
76
+ | Relational data | ✅ Best | ✅ Good | ❌ | ✅ Good | ❌ |
77
+ | Document-heavy | ⚠️ JSONB | ⚠️ JSON | ✅ Best | ❌ | ✅ Good |
78
+ | Hobby/MVP | ✅ Good | ✅ Good | ✅ Good | ✅ Best | ⚠️ Overkill |
79
+ | Enterprise scale | ✅ Best | ✅ Good | ✅ Good | ❌ | ✅ Best |
80
+ | Serverless | ⚠️ Need pooling | ⚠️ Need pooling | ✅ Atlas | ✅ Turso/Litestream | ✅ Native |
81
+
82
+ ### 2.3 Folder Structure Generation
83
+
84
+ Generate an opinionated folder structure based on the selected stack. Example for Next.js:
85
+
86
+ ```
87
+ project-root/
88
+ ├── src/
89
+ │ ├── app/ # Next.js App Router pages
90
+ │ │ ├── (auth)/ # Auth route group
91
+ │ │ ├── (dashboard)/ # Dashboard route group
92
+ │ │ ├── api/ # API routes
93
+ │ │ ├── layout.tsx
94
+ │ │ └── page.tsx
95
+ │ ├── components/
96
+ │ │ ├── ui/ # Reusable UI primitives
97
+ │ │ └── features/ # Feature-specific components
98
+ │ ├── lib/ # Shared utilities
99
+ │ ├── server/ # Server-only code
100
+ │ │ ├── db/ # Database client & queries
101
+ │ │ ├── auth/ # Auth configuration
102
+ │ │ └── services/ # Business logic
103
+ │ └── types/ # Shared type definitions
104
+ ├── prisma/
105
+ │ └── schema.prisma
106
+ ├── tests/
107
+ │ ├── unit/
108
+ │ ├── integration/
109
+ │ └── e2e/
110
+ ├── .github/
111
+ │ └── workflows/
112
+ ├── knowledge-base/ # Pre-filled engineering intelligence
113
+ ├── .engineering-intelligence/
114
+ │ ├── memory/
115
+ │ ├── context/
116
+ │ ├── events/
117
+ │ ├── graph/
118
+ │ └── reports/
119
+ ├── engineering.config.json
120
+ ├── .env.example
121
+ └── ...config files
122
+ ```
123
+
124
+ ### 2.4 ADR Generation
125
+
126
+ Generate initial Architectural Decision Records for key choices:
127
+
128
+ | ADR | Content |
129
+ |---|---|
130
+ | `ADR-001-tech-stack.md` | Why this framework/language was chosen |
131
+ | `ADR-002-database.md` | Why this database and ORM were chosen |
132
+ | `ADR-003-auth.md` | Why this auth strategy was chosen |
133
+ | `ADR-004-deployment.md` | Why this deployment target was chosen |
134
+ | `ADR-005-testing.md` | Why this testing strategy was chosen |
135
+ | `ADR-006-project-structure.md` | Why this folder structure was chosen |
136
+
137
+ Each ADR follows the format:
138
+ ```markdown
139
+ # ADR-NNN: <Title>
140
+
141
+ ## Status: Accepted
142
+ ## Date: <date>
143
+
144
+ ## Context
145
+ <what prompted this decision>
146
+
147
+ ## Decision
148
+ <what was decided>
149
+
150
+ ## Consequences
151
+ <positive and negative impacts>
152
+
153
+ ## Alternatives Considered
154
+ <what else was evaluated and why it was rejected>
155
+ ```
156
+
157
+ ### 2.5 CI/CD Generation
158
+
159
+ Generate CI/CD configuration based on deployment target:
160
+
161
+ | Deployment | CI/CD Tool | Pipeline Stages |
162
+ |---|---|---|
163
+ | Vercel | GitHub Actions + Vercel | Lint → Type Check → Test → Preview Deploy → Prod Deploy |
164
+ | AWS | GitHub Actions + AWS CDK/SAM | Lint → Test → Build → Staging Deploy → Prod Deploy |
165
+ | GCP | GitHub Actions + Cloud Build | Lint → Test → Build → Cloud Run Deploy |
166
+ | Self-hosted | GitHub Actions + Docker | Lint → Test → Build Image → Push → Deploy |
167
+
168
+ ### 2.6 Testing Strategy
169
+
170
+ | Test Type | Tool | What to Test | Coverage Target |
171
+ |---|---|---|---|
172
+ | Unit | Jest/Vitest/pytest | Business logic, utilities, pure functions | 80% |
173
+ | Integration | Supertest/httpx/Spring Test | API endpoints, database queries, auth flows | Key paths |
174
+ | E2E | Playwright/Cypress | Critical user journeys (signup, core feature, payment) | Happy paths |
175
+ | Component | Testing Library/Storybook | UI components in isolation | Key components |
176
+
177
+ ## Phase 3: Scaffold Output
178
+
179
+ Generate all files for the new project.
180
+
181
+ ### 3.1 Configuration Files
182
+
183
+ | File | Content |
184
+ |---|---|
185
+ | `engineering.config.json` | Project metadata, tech stack, conventions, sync settings |
186
+ | `.env.example` | All required environment variables with placeholder values and comments |
187
+ | `tsconfig.json` / `pyproject.toml` / etc. | Language-appropriate config with strict settings |
188
+ | `.eslintrc` / `ruff.toml` / etc. | Linter config matching conventions |
189
+ | `.prettierrc` / etc. | Formatter config |
190
+ | `.gitignore` | Comprehensive gitignore for the selected stack |
191
+
192
+ ### 3.2 Pre-filled Knowledge Base
193
+
194
+ Generate starter versions of all knowledge base documents (00–16) with:
195
+ - Architecture decisions from Phase 2 as content
196
+ - `**Not yet implemented**` for areas that will be built
197
+ - Evidence citations pointing to generated config files
198
+ - Conventions from Phase 2 decisions pre-populated in `16-conventions.md`
199
+
200
+ ### 3.3 Pre-filled Memory
201
+
202
+ | Memory File | Pre-filled Content |
203
+ |---|---|
204
+ | `architecture-decisions.md` | ADRs from Phase 2 |
205
+ | `technology-decisions.md` | Tech stack rationale |
206
+ | `coding-patterns.md` | Conventions chosen during scaffold |
207
+ | `project-constraints.md` | Scale, deployment, team constraints from interview |
208
+ | `business-rules.md` | Core features and domain concepts from interview |
209
+
210
+ ### 3.4 Pre-filled Context
211
+
212
+ | Context File | Pre-filled Content |
213
+ |---|---|
214
+ | `module-map.md` | Planned module structure from folder layout |
215
+ | `critical-paths.md` | Core feature flows identified in interview |
216
+
217
+ ### 3.5 Event Guidance
218
+
219
+ Generate starter event guidance files with generic templates appropriate for the chosen stack.
220
+
221
+ ### 3.6 Engineering Config
222
+
223
+ ```json
224
+ {
225
+ "project": "<name>",
226
+ "version": "0.1.0",
227
+ "stack": {
228
+ "language": "<primary language>",
229
+ "framework": "<framework>",
230
+ "database": "<database>",
231
+ "orm": "<orm>",
232
+ "auth": "<auth solution>",
233
+ "deployment": "<deployment target>"
234
+ },
235
+ "conventions": {
236
+ "naming": "<chosen naming convention>",
237
+ "testing": "<chosen test strategy>",
238
+ "branching": "<chosen git strategy>"
239
+ },
240
+ "intelligence": {
241
+ "initialized": true,
242
+ "initializedAt": "<timestamp>",
243
+ "method": "greenfield-architect"
244
+ }
245
+ }
246
+ ```
247
+
248
+ ## Procedure
249
+
250
+ 1. **Greet and assess** — Check if the user has provided any upfront context. Extract answers from any provided brief.
251
+ 2. **Run interview** — Ask Phase 1 questions, skipping any already answered. Present defaults.
252
+ 3. **Summarize requirements** — Present a complete requirements summary and get confirmation.
253
+ 4. **Select tech stack** — Apply Phase 2 decision matrices. Present recommendation with reasoning.
254
+ 5. **Get stack approval** — Allow the user to override any recommendation.
255
+ 6. **Generate folder structure** — Create the directory layout based on approved stack.
256
+ 7. **Generate ADRs** — Write ADR documents for each major decision.
257
+ 8. **Generate CI/CD** — Create pipeline configuration for the deployment target.
258
+ 9. **Generate configs** — Create all configuration files (linter, formatter, tsconfig, etc.).
259
+ 10. **Generate knowledge base** — Pre-fill all knowledge base documents.
260
+ 11. **Generate memory** — Pre-fill memory with decisions and constraints.
261
+ 12. **Generate context** — Pre-fill context with planned module structure.
262
+ 13. **Generate event guidance** — Create starter event guidance templates.
263
+ 14. **Write engineering.config.json** — Create the project configuration file.
264
+ 15. **Create .env.example** — List all required environment variables.
265
+ 16. **Report** — Summarize everything generated and list next steps for the developer.
266
+
267
+ ## Quality Gates
268
+
269
+ - [ ] Requirements interview asked between 7 and 12 questions
270
+ - [ ] Requirements summary was confirmed before architecture generation
271
+ - [ ] Tech stack recommendation includes reasoning tied to interview answers
272
+ - [ ] At least 5 ADRs are generated for major decisions
273
+ - [ ] Folder structure matches the selected framework's conventions
274
+ - [ ] CI/CD pipeline includes at minimum: lint, test, build, deploy stages
275
+ - [ ] `.env.example` lists all required environment variables with descriptions
276
+ - [ ] Knowledge base documents (00–16) are pre-filled with scaffolded content
277
+ - [ ] Memory files contain only durable decisions (not transient implementation details)
278
+ - [ ] `engineering.config.json` exists with complete project metadata
279
+ - [ ] Testing strategy is defined with tool selection and coverage targets
280
+ - [ ] All generated files use evidence citations pointing to other generated files
281
+
282
+ ## Cross-References
283
+
284
+ - Uses: `codebase-discovery-engine` (for post-scaffold verification)
285
+ - Feeds into: `initialize-intelligence-skill` (provides the initial knowledge baseline)
286
+ - Consumed by: `engineering-intelligence-skill`, `engineering-orchestrator`
287
+ - Related: `convention-detector` (validates conventions after initial development)
@@ -32,9 +32,13 @@ Determine what can break before changing code. Produce a reusable impact report
32
32
  - Services communicating with changed services (from service-graph)
33
33
  - Runtime flows passing through changed code (from runtime-graph)
34
34
  - Business processes affected (from business-flow-graph)
35
+ - Data pipelines affected (from data-flow-graph)
35
36
  - Test suites covering affected code
37
+ - Cross-reference with git change coupling data from `git-intelligence-engine` for hidden dependencies
36
38
 
37
- 5. **Score Risk** — Assign risk based on:
39
+ 5. **Trace Transitive Impact** — Follow 2nd and 3rd order effects through the graph. Identify files that are indirectly affected by consumers of the directly affected modules. Walk the dependency chain until impact attenuates or reaches a service boundary.
40
+
41
+ 6. **Score Risk** — Assign risk based on:
38
42
 
39
43
  | Factor | Low | Medium | High | Critical |
40
44
  |---|---|---|---|---|
@@ -43,8 +47,9 @@ Determine what can break before changing code. Produce a reusable impact report
43
47
  | **Auth impact** | None | UI changes | Permission logic | Auth flow |
44
48
  | **API contract** | None | Additive | Deprecated | Breaking |
45
49
  | **Test coverage** | Well-tested | Partial | Sparse | None |
50
+ | **Change coupling** | None | Low (1-2 coupled files) | Medium (3-5 coupled files) | High (6+ coupled files) |
46
51
 
47
- 6. **Identify Validation Needs** — Map impact to required validation:
52
+ 7. **Identify Validation Needs** — Map impact to required validation:
48
53
 
49
54
  | Impact Area | Validation Required |
50
55
  |---|---|
@@ -55,7 +60,9 @@ Determine what can break before changing code. Produce a reusable impact report
55
60
  | UI change | Visual regression, accessibility |
56
61
  | Infrastructure | Deploy to staging, smoke test |
57
62
 
58
- 7. **Map Intelligence Artifacts** — Determine which intelligence artifacts need synchronization after the change is implemented.
63
+ 8. **Map Intelligence Artifacts** — Determine which intelligence artifacts need synchronization after the change is implemented.
64
+
65
+ > **Surprise Impact Detection**: Flag any dependency discovered during analysis that is NOT in the current graph — these are surprise impacts that should be added to the graph. Surprise impacts indicate missing edges or nodes and must be reported in the Unknowns section of the impact report.
59
66
 
60
67
  ## Output Format
61
68
 
@@ -129,6 +136,7 @@ Write `.engineering-intelligence/reports/IMP-XXX-<slug>.md`:
129
136
 
130
137
  ## Cross-References
131
138
 
132
- - Depends on: `change-detection-engine`, `graph-engine`
139
+ - Depends on: `change-detection-engine`, `graph-engine`, `git-intelligence-engine`
140
+ - Consults: `data-flow-graph.json` (for data pipeline impact)
133
141
  - Used by: `engineering-intelligence-skill`, `incremental-sync-engine`, `analyze-impact` workflow
134
142
  - Consumed by: `engineering-change-review`, `testing-intelligence-engine`
@@ -30,6 +30,8 @@ Use this matrix to determine which artifact types need updating based on the cha
30
30
  | Refactor (no behavior change) | — | `coding-patterns.md` | affected maps | — | dependency-graph | — |
31
31
  | Test changes only | — | — | — | — | — | — |
32
32
  | Config/env changes | `09-infrastructure.md` | `project-constraints.md` | — | — | — | — |
33
+ | Convention changed | `16-conventions.md` | `coding-patterns.md` | — | — | — | — |
34
+ | Security concern detected | `20-security-assessment.md` | — | — | — | — | — |
33
35
 
34
36
  ## Procedure
35
37
 
@@ -62,6 +64,20 @@ Use this matrix to determine which artifact types need updating based on the cha
62
64
 
63
65
  8. **Update Impact Report** — Add a synchronization notes section to the original impact report recording what was synced.
64
66
 
67
+ 9. **Check Freshness** — After sync, update freshness metadata on all modified documents. If any document freshness score drops below 40, flag for full re-verification using `staleness-detector`.
68
+
69
+ ## Confidence Decay
70
+
71
+ Confidence scores decrease over time without re-verification:
72
+
73
+ | Changes Since Last Verification | Confidence Level |
74
+ |---|---|
75
+ | 0–9 changes | Maintains current confidence |
76
+ | 10–24 changes | Drops from `verified` to `inferred` |
77
+ | 25+ changes | Drops to `unknown` |
78
+
79
+ During sync, check how many changes have occurred since each artifact was last verified. Apply decay rules and flag artifacts that have dropped confidence for re-verification.
80
+
65
81
  ## Rules
66
82
 
67
83
  - **Incremental only**: Update only artifacts identified by the impact report — never regenerate unrelated content
@@ -84,3 +100,4 @@ Use this matrix to determine which artifact types need updating based on the cha
84
100
  - Depends on: `change-detection-engine`, `impact-analysis-engine`, `graph-engine`
85
101
  - Used by: `engineering-intelligence-skill`, `sync-engineering-intelligence` workflow
86
102
  - Delegates to: `knowledge-sync-engine`, `memory-sync-engine`, `context-sync-engine`
103
+ - Integrates with: `staleness-detector` (freshness checks), `convention-detector` (convention sync)
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: mcp-security-governor
3
+ description: Reviews MCP tools and external execution surfaces for scoped authorization, schema integrity, sandboxing, and human approval gates.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # MCP Security Governor
8
+
9
+ Use this skill when a project configures MCP servers, external tool execution, CI/CD automation, database access, deployment tools, or any agent-callable side effect.
10
+
11
+ ## Security Model
12
+
13
+ Check for defense in depth:
14
+ - OAuth 2.1 or equivalent modern authorization for remote servers
15
+ - PKCE for public clients where applicable
16
+ - Server metadata validation before authorization
17
+ - Tool-level permissions rather than server-level blanket permissions
18
+ - Explicit user approval for destructive or irreversible actions
19
+ - Tool schema hashing or pinning to detect schema drift
20
+ - Sandboxed local execution with workspace-scoped filesystem access
21
+ - Secrets kept out of prompts, logs, artifacts, and generated documentation
22
+
23
+ ## MCP Review Artifact
24
+
25
+ Write `.engineering-intelligence/aidlc/operations/mcp-security-review.md`:
26
+
27
+ ```markdown
28
+ # MCP Security Review
29
+
30
+ ## Configurations Reviewed
31
+ - <path or Not detected>
32
+
33
+ ## Tool Inventory
34
+ | Server | Tool | Capability | Permission Scope | Destructive | Approval Required |
35
+ |---|---|---|---|---|---|
36
+
37
+ ## Risks
38
+ - <risk, evidence, severity>
39
+
40
+ ## Required Controls
41
+ - <control and implementation owner>
42
+
43
+ ## Approval Boundaries
44
+ - <actions that must never run without human confirmation>
45
+ ```
46
+
47
+ ## Rules
48
+
49
+ - Do not grant a tool broader filesystem, network, or deployment permission than the task requires.
50
+ - Treat changed tool definitions as untrusted until revalidated.
51
+ - Destructive actions must expose raw parameters to the user before execution.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: nfr-adr-governor
3
+ description: Captures non-functional requirements, maps them to architectural patterns, and governs ADR lifecycle states.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # NFR And ADR Governor
8
+
9
+ Use this skill for performance, reliability, security, privacy, compliance, scalability, compatibility, migration, and operational constraints.
10
+
11
+ ## NFR Requirements
12
+
13
+ Write `.engineering-intelligence/aidlc/construction/<unit>/nfr-requirements.md`:
14
+
15
+ ```markdown
16
+ # NFR Requirements: <unit>
17
+
18
+ | Dimension | Target | Evidence / Source | Validation Method |
19
+ |---|---|---|---|
20
+ | Latency | <p50/p95/p99> | <source> | <test/monitor> |
21
+ | Throughput | <target> | <source> | <load/perf test> |
22
+ | Reliability | <SLO/SLA> | <source> | <failure test> |
23
+ | Security | <standard/control> | <source> | <scan/review/test> |
24
+ | Data | <volume/retention/migration> | <source> | <migration/test> |
25
+ | Compatibility | <API/browser/runtime> | <source> | <contract test> |
26
+ ```
27
+
28
+ ## NFR Design
29
+
30
+ Write `.engineering-intelligence/aidlc/construction/<unit>/nfr-design/design.md` with concrete patterns. Examples: circuit breaker with exponential backoff, idempotency keys, bulkheads, rate limits, schema expansion/contraction, cache invalidation, trace correlation, policy-based authorization.
31
+
32
+ ## ADR Lifecycle
33
+
34
+ Create an ADR only when two or more distinct alternatives were considered.
35
+
36
+ Allowed states:
37
+ - `Proposed`
38
+ - `Accepted`
39
+ - `Rejected`
40
+ - `Superseded`
41
+
42
+ Accepted ADRs are immutable. To change one, create a new `Proposed` ADR and mark the old accepted ADR as `Superseded by ADR-NNNN` after the new decision is accepted.
43
+
44
+ ADR path:
45
+
46
+ ```text
47
+ .engineering-intelligence/aidlc/construction/<unit>/nfr-design/decision-records/ADR-NNNN-<slug>.md
48
+ ```
49
+
50
+ ADR template:
51
+
52
+ ```markdown
53
+ # ADR-NNNN: <decision>
54
+
55
+ ## Status
56
+ Proposed
57
+
58
+ ## Context
59
+ <problem, constraints, NFR drivers>
60
+
61
+ ## Options Considered
62
+ - Option A: <tradeoffs>
63
+ - Option B: <tradeoffs>
64
+
65
+ ## Decision
66
+ <chosen option when accepted>
67
+
68
+ ## Consequences
69
+ - Positive: <benefits>
70
+ - Negative: <costs>
71
+ - Validation: <how this will be tested>
72
+
73
+ ## Supersedes / Superseded By
74
+ <links or Not applicable>
75
+ ```
76
+
77
+ ## Quality Gates
78
+
79
+ - [ ] NFRs are measurable where possible
80
+ - [ ] Design patterns map back to NFR targets
81
+ - [ ] ADR exists only when alternatives were considered
82
+ - [ ] ADR state transitions are explicit
83
+ - [ ] Accepted ADRs are not edited except to mark supersession