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
@@ -0,0 +1,199 @@
1
+ ---
2
+ name: convention-detector
3
+ description: Detects and codifies project conventions by analyzing naming patterns, import organization, code structure, API patterns, test patterns, git conventions, and architecture patterns. Produces a conventions document and enhances coding-patterns memory.
4
+ version: 3.0.0
5
+ ---
6
+
7
+ # Convention Detector
8
+
9
+ Systematically analyze a codebase to detect, classify, and document conventions that are implicitly followed but not explicitly written down. Conventions are inferred from statistical patterns across the codebase — a pattern must appear in >70% of relevant files to be classified as a convention.
10
+
11
+ This capability does not modify product code.
12
+
13
+ ## Inputs
14
+
15
+ - Repository root path
16
+ - Optional: scope constraints (specific package, service, or directory)
17
+ - Optional: output from `codebase-discovery-engine` (tech stack, framework, file patterns)
18
+
19
+ ## Procedure
20
+
21
+ 1. **Sample files** — Select a representative sample of at least 20 source files across different modules. Prioritize recently modified files and files by different contributors to capture team-wide conventions (not individual habits).
22
+
23
+ 2. **Detect naming conventions** — Analyze the following naming patterns:
24
+
25
+ | Target | What to Detect | Example Patterns |
26
+ |---|---|---|
27
+ | Variables | camelCase, snake_case, PascalCase, SCREAMING_SNAKE | `userName` vs `user_name` |
28
+ | Functions | camelCase, snake_case, verb-first, noun-first | `getUser()` vs `user_get()` |
29
+ | Classes/Types | PascalCase, suffixes (Service, Controller, Repository) | `UserService`, `AuthMiddleware` |
30
+ | Files | kebab-case, camelCase, PascalCase, dot-separated | `user-service.ts` vs `UserService.ts` |
31
+ | Directories | singular, plural, kebab-case, camelCase | `model/` vs `models/` |
32
+ | Tests | `.test.`, `.spec.`, `_test`, `Test` suffix | `user.test.ts` vs `user.spec.ts` |
33
+ | Constants | SCREAMING_SNAKE, PascalCase enum members | `MAX_RETRIES`, `HttpStatus.OK` |
34
+ | Database | snake_case tables, camelCase columns, pluralization | `user_accounts` vs `UserAccount` |
35
+ | API routes | kebab-case, snake_case, camelCase, plural resources | `/api/user-accounts` vs `/api/userAccounts` |
36
+
37
+ 3. **Detect import organization** — Analyze import blocks for:
38
+
39
+ | Pattern | What to Detect |
40
+ |---|---|
41
+ | **Grouping** | External → internal → relative? Alphabetical within groups? |
42
+ | **Path style** | Absolute (`@/components/Button`) vs relative (`../../components/Button`) |
43
+ | **Path aliases** | `@/`, `~/`, `#/` — check `tsconfig.json` paths, webpack aliases |
44
+ | **Barrel files** | `index.ts` re-exports? Per-directory or selective? |
45
+ | **Type imports** | Separate `import type` vs inline `type` keyword |
46
+ | **Wildcard imports** | `import * as` usage frequency |
47
+ | **Default vs named** | Preference for default or named exports |
48
+ | **Side-effect imports** | CSS/style imports, polyfills |
49
+
50
+ 4. **Detect code structure patterns** — Analyze:
51
+
52
+ | Pattern | What to Detect |
53
+ |---|---|
54
+ | **Paradigm** | Functional vs class-based vs mixed |
55
+ | **Error handling** | Try-catch, Result/Either types, error-first callbacks, custom error classes |
56
+ | **Logging** | Logger library, log levels, structured logging, log format |
57
+ | **Validation** | Zod, Joi, class-validator, manual checks, where validation lives |
58
+ | **Configuration** | Environment variables, config files, feature flags, config patterns |
59
+ | **Dependency injection** | Constructor injection, container-based, module-based, manual wiring |
60
+ | **Async patterns** | async/await, Promises, callbacks, Observables |
61
+ | **Null handling** | Optional chaining, null checks, Maybe/Option types, assertions |
62
+ | **Comment style** | JSDoc, docstrings, inline comments, section headers |
63
+ | **Function length** | Typical function LOC, max observed, decomposition style |
64
+ | **Module exports** | Single responsibility per file? Multiple exports? |
65
+
66
+ 5. **Detect API patterns** — Analyze API endpoints for:
67
+
68
+ | Pattern | What to Detect |
69
+ |---|---|
70
+ | **REST conventions** | Resource naming, HTTP method usage, nested resources |
71
+ | **Response envelope** | `{ data, error, meta }` vs raw responses vs `{ success, result }` |
72
+ | **Error format** | Error codes, error messages, error detail structure |
73
+ | **Pagination** | Cursor-based, offset-based, page-based, query params |
74
+ | **Versioning** | URL path (`/v1/`), header-based, query param |
75
+ | **Auth headers** | Bearer token, API key, cookie-based |
76
+ | **Request validation** | Schema validation middleware, manual checks |
77
+ | **Status codes** | Consistent status code usage patterns |
78
+ | **Serialization** | camelCase vs snake_case in JSON responses |
79
+
80
+ 6. **Detect test patterns** — Analyze test files for:
81
+
82
+ | Pattern | What to Detect |
83
+ |---|---|
84
+ | **File placement** | Co-located (`__tests__/`, adjacent), separate `test/` tree, or `spec/` |
85
+ | **Naming** | `*.test.*`, `*.spec.*`, `*_test.*`, `Test*` prefix |
86
+ | **Structure** | `describe`/`it` nesting, flat tests, BDD-style, given-when-then |
87
+ | **Assertion style** | `expect().toBe()`, `assert.*`, `should.*`, custom matchers |
88
+ | **Mocking** | `jest.mock()`, `vi.mock()`, dependency injection, manual stubs |
89
+ | **Fixtures** | Factory functions, fixture files, inline data, builders |
90
+ | **Setup/teardown** | `beforeEach`/`afterEach`, `setup()`/`teardown()`, per-test setup |
91
+ | **Coverage** | Coverage thresholds, ignored paths, branch vs line coverage |
92
+ | **Integration tests** | Database setup, API testing, test containers |
93
+ | **E2E tests** | Page objects, test selectors (`data-testid`), base URLs |
94
+
95
+ 7. **Detect git patterns** — Analyze git history and config for:
96
+
97
+ | Pattern | What to Detect |
98
+ |---|---|
99
+ | **Commit format** | Conventional commits, free-form, ticket references, emoji |
100
+ | **Branch naming** | `feature/`, `fix/`, `chore/`, ticket number prefix, kebab-case |
101
+ | **PR conventions** | PR templates, required reviewers, auto-merge, squash vs merge |
102
+ | **Release process** | Tags, changelogs, release branches, semantic versioning |
103
+ | **Hooks** | Husky, lefthook, pre-commit, lint-staged |
104
+ | **Merge strategy** | Squash merge, merge commits, rebase, linear history |
105
+
106
+ 8. **Detect architecture patterns** — Analyze structural boundaries:
107
+
108
+ | Pattern | What to Detect |
109
+ |---|---|
110
+ | **Layer boundaries** | Clear separation of presentation/business/data layers |
111
+ | **Module boundaries** | Feature-based, layer-based, domain-based organization |
112
+ | **State management** | Redux, Zustand, Jotai, MobX, React Context, Vuex/Pinia, signals |
113
+ | **Data fetching** | React Query, SWR, tRPC, REST clients, GraphQL clients |
114
+ | **Middleware chains** | Ordered middleware, decorator patterns, interceptors |
115
+ | **Event patterns** | Event emitters, pub/sub, event sourcing, domain events |
116
+ | **Repository pattern** | Data access abstraction, query encapsulation |
117
+ | **Service pattern** | Business logic isolation, service layer thickness |
118
+
119
+ 9. **Calculate adherence scores** — For each detected convention, calculate:
120
+ - **Adherence rate**: percentage of relevant files/instances following the convention
121
+ - **Exceptions**: specific files or modules that deviate (and possible reasons)
122
+ - **Confidence**: how certain the detection is (based on sample size)
123
+
124
+ 10. **Write conventions document** — Generate `knowledge-base/16-conventions.md` following the output format below.
125
+
126
+ 11. **Enhance coding patterns memory** — Update `.engineering-intelligence/memory/coding-patterns.md` with durable conventions that are unlikely to change.
127
+
128
+ ## Output: `knowledge-base/16-conventions.md`
129
+
130
+ ```markdown
131
+ # Project Conventions
132
+
133
+ Generated: <timestamp>
134
+ Sample size: <N files analyzed across M modules>
135
+
136
+ ## Naming Conventions
137
+
138
+ | Target | Convention | Adherence | Exceptions | Evidence |
139
+ |---|---|---|---|---|
140
+ | Variables | camelCase | 98% | None | Sampled 150 variable declarations |
141
+ | Files | kebab-case | 94% | Legacy `utils/` dir uses camelCase | `src/components/user-profile.tsx` |
142
+ | ... | ... | ... | ... | ... |
143
+
144
+ ## Import Organization
145
+
146
+ <detected import ordering rules, path conventions, barrel file usage>
147
+
148
+ ## Code Structure
149
+
150
+ <paradigm, error handling, logging, validation patterns>
151
+
152
+ ## API Conventions
153
+
154
+ <REST conventions, response format, error format>
155
+
156
+ ## Test Conventions
157
+
158
+ <file placement, naming, assertion style, mocking approach>
159
+
160
+ ## Git Conventions
161
+
162
+ <commit format, branch naming, merge strategy>
163
+
164
+ ## Architecture Conventions
165
+
166
+ <layer boundaries, module organization, state management>
167
+
168
+ ## Convention Violations
169
+
170
+ | Convention | Violation | Location | Severity |
171
+ |---|---|---|---|
172
+ | ... | ... | ... | ... |
173
+ ```
174
+
175
+ ## Output: `.engineering-intelligence/memory/coding-patterns.md` (Enhanced)
176
+
177
+ Add a `## Conventions` section with only durable patterns that pass the durability check: "Will this convention still be relevant after 10+ more changes?"
178
+
179
+ ## Quality Gates
180
+
181
+ - [ ] At least 20 source files sampled across different modules
182
+ - [ ] Naming convention detection covers files, variables, functions, and types
183
+ - [ ] Import organization patterns are documented with examples
184
+ - [ ] Test patterns include file placement and assertion style
185
+ - [ ] Git conventions are extracted from actual git history (not assumed)
186
+ - [ ] Each convention has an adherence rate and evidence citation
187
+ - [ ] Exceptions to conventions are listed (not hidden)
188
+ - [ ] `knowledge-base/16-conventions.md` exists and follows the output format
189
+ - [ ] `coding-patterns.md` is enhanced with a Conventions section
190
+ - [ ] Only patterns with >70% adherence are classified as conventions
191
+
192
+ ## Cross-References
193
+
194
+ - Depends on: `codebase-discovery-engine` (tech stack context)
195
+ - Used by: `initialize-intelligence-skill`, `engineering-intelligence-skill`
196
+ - Feeds into: `knowledge-base/16-conventions.md`, `.engineering-intelligence/memory/coding-patterns.md`
197
+ - Consumed by: `ongoing-learning-engine` (for convention drift detection)
198
+
199
+ This capability does not modify product code.
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: debugging-engine
3
+ description: Performs structured root cause analysis using graph intelligence, log correlation, error propagation tracing, and reproduction step generation. Produces evidence-backed debug reports with fix suggestions and impact analysis.
4
+ version: 3.0.0
5
+ ---
6
+
7
+ # Debugging Engine
8
+
9
+ Systematically diagnose issues through evidence-driven root cause analysis, leveraging graph intelligence to trace error propagation and suggest fixes with assessed impact.
10
+
11
+ ## Inputs
12
+
13
+ - Bug report or error description (symptoms, error messages, stack traces)
14
+ - Repository root path
15
+ - Graph intelligence from `.engineering-intelligence/graph/` (when available)
16
+ - Project intelligence from `knowledge-base/` and `.engineering-intelligence/`
17
+ - Optional: log output, reproduction steps from reporter, environment details
18
+
19
+ ## Procedure
20
+
21
+ 1. **Classify the Issue** — Determine the bug category and initial scope:
22
+
23
+ | Category | Indicators |
24
+ |---|---|
25
+ | Runtime error | Stack trace, exception, crash |
26
+ | Logic error | Wrong output, incorrect behavior, data corruption |
27
+ | Performance | Slowness, timeouts, resource exhaustion |
28
+ | Integration | API failures, service communication errors |
29
+ | Concurrency | Race conditions, deadlocks, data inconsistency |
30
+ | Configuration | Environment-specific failures, missing config |
31
+
32
+ 2. **Root Cause Analysis Workflow** — Follow a structured elimination process:
33
+
34
+ a. **Reproduce** — Determine the minimal conditions to trigger the issue:
35
+ - Identify required inputs, state, and environment
36
+ - Distinguish deterministic from intermittent failures
37
+ - Note any timing or ordering dependencies
38
+
39
+ b. **Localize** — Narrow the fault location:
40
+ - Start from the error manifestation point (stack trace, log entry)
41
+ - Trace backward through the call chain
42
+ - Use graph intelligence to understand the execution path
43
+ - Identify the boundary between working and failing behavior
44
+
45
+ c. **Identify** — Determine the root cause:
46
+ - Distinguish symptom from cause — trace to the origin
47
+ - Check for recent changes in the fault area (correlate with git history)
48
+ - Verify assumptions about inputs, state, and invariants
49
+ - Consider environmental factors (config, dependencies, infrastructure)
50
+
51
+ 3. **Log Analysis and Correlation** — When logs are available:
52
+
53
+ | Technique | Application |
54
+ |---|---|
55
+ | Timeline reconstruction | Order events chronologically across log sources |
56
+ | Pattern matching | Identify recurring error patterns and frequencies |
57
+ | Correlation | Link events across services using request IDs or trace IDs |
58
+ | Anomaly detection | Identify unusual log patterns preceding the failure |
59
+ | Context extraction | Extract relevant state from surrounding log entries |
60
+
61
+ 4. **Error Propagation Tracing** — Using graph intelligence:
62
+
63
+ - Trace the error path through `runtime-graph.json` (call flows)
64
+ - Identify affected services via `service-graph.json` (communication topology)
65
+ - Map downstream impact via `dependency-graph.json` (module dependencies)
66
+ - Assess business impact via `business-flow-graph.json` (affected flows)
67
+
68
+ Build an error propagation chain:
69
+
70
+ ```
71
+ Origin → [module/function where fault occurs]
72
+ ↓ propagates via [mechanism: exception, error return, bad state]
73
+ Intermediate → [modules that pass through or transform the error]
74
+ ↓ manifests as [observable symptom]
75
+ Symptom → [where the user or system observes the failure]
76
+ ```
77
+
78
+ 5. **Reproduction Step Generation** — Produce minimal, deterministic reproduction steps:
79
+
80
+ ```markdown
81
+ ## Reproduction Steps
82
+ 1. Preconditions: <required state, config, data>
83
+ 2. Action: <specific steps to trigger the issue>
84
+ 3. Expected: <what should happen>
85
+ 4. Actual: <what happens instead>
86
+ 5. Environment: <runtime, OS, versions, config>
87
+ 6. Frequency: deterministic | intermittent (<rate>)
88
+ ```
89
+
90
+ 6. **Fix Suggestion with Impact Analysis** — Propose fixes with assessed risk:
91
+
92
+ | Fix Aspect | Description |
93
+ |---|---|
94
+ | Root fix | Address the underlying cause |
95
+ | Symptom mitigation | Temporary workaround if root fix is complex |
96
+ | Defensive hardening | Additional checks to prevent recurrence class |
97
+ | Files to modify | Specific files and functions that need changes |
98
+ | Risk assessment | Blast radius of the proposed fix |
99
+ | Test requirements | Tests to add for regression prevention |
100
+
101
+ When applicable, invoke `impact-analysis-engine` on the proposed fix to assess its blast radius.
102
+
103
+ 7. **Generate Debug Report** — Write `.engineering-intelligence/reports/DEBUG-XXX-<slug>.md`.
104
+
105
+ ## Output Format
106
+
107
+ Write `.engineering-intelligence/reports/DEBUG-XXX-<slug>.md`:
108
+
109
+ ```markdown
110
+ # DEBUG-XXX: <descriptive title>
111
+
112
+ ## Meta
113
+ - Generated: <ISO timestamp>
114
+ - Category: <runtime | logic | performance | integration | concurrency | configuration>
115
+ - Severity: <critical | high | medium | low>
116
+ - Status: <diagnosed | investigating | unresolved>
117
+
118
+ ## Symptoms
119
+ - <observable manifestation of the issue>
120
+ - Error message: `<exact error text>`
121
+ - Stack trace: <if available>
122
+
123
+ ## Root Cause Analysis
124
+ - **Root cause**: <concise description>
125
+ - **Origin**: <file:line where the fault originates>
126
+ - **Mechanism**: <how the fault propagates>
127
+ - **Contributing factors**: <environmental or contextual factors>
128
+
129
+ ## Error Propagation
130
+ | Step | Location | Mechanism | Evidence |
131
+ |---|---|---|---|
132
+ | Origin | src/auth/validate.ts:42 | Null reference | Missing null check |
133
+ | Propagation | src/api/middleware.ts:18 | Unhandled exception | No try/catch |
134
+ | Symptom | HTTP 500 response | Error response | Client-reported |
135
+
136
+ ## Reproduction Steps
137
+ 1. <minimal reproduction steps>
138
+
139
+ ## Fix Suggestion
140
+ ### Root Fix
141
+ - File: <path>
142
+ - Change: <description>
143
+ - Risk: <level>
144
+
145
+ ### Defensive Hardening
146
+ - <additional preventive measures>
147
+
148
+ ### Test Requirements
149
+ - [ ] <regression test to add>
150
+
151
+ ## Impact of Fix
152
+ - Blast radius: <assessment>
153
+ - Affected modules: <list>
154
+
155
+ ## Evidence
156
+ - <file path citations>
157
+
158
+ ## Unknowns
159
+ - <unresolved questions>
160
+
161
+ ---
162
+ *This debug report did not modify product code.*
163
+ ```
164
+
165
+ ## Rules
166
+
167
+ - Never guess the root cause — trace with evidence or mark as `investigating`
168
+ - Distinguish symptoms from causes explicitly
169
+ - Fix suggestions must include impact assessment
170
+ - Log analysis must not expose sensitive data (redact credentials, PII)
171
+ - This capability is analytical only — it must not modify product code
172
+
173
+ ## Quality Gates
174
+
175
+ - [ ] Issue is classified by category and severity
176
+ - [ ] Root cause is traced with evidence (not assumed)
177
+ - [ ] Error propagation path is documented with graph references
178
+ - [ ] Reproduction steps are minimal and actionable
179
+ - [ ] Fix suggestion includes impact assessment and test requirements
180
+ - [ ] Sensitive data is redacted from logs and traces in the report
181
+ - [ ] Report ends with the "did not modify product code" statement
182
+
183
+ ## Cross-References
184
+
185
+ - Depends on: `graph-engine` (error propagation tracing), `impact-analysis-engine` (fix impact assessment)
186
+ - Used by: `engineering-intelligence-skill`
187
+ - Consumed by: `engineering-change-review` (when fix is implemented as a change)
188
+
189
+ This capability is analytical only. It must not modify product code.
@@ -34,6 +34,7 @@ Classify the incoming request before starting:
34
34
 
35
35
  Read these artifacts and identify relevant context:
36
36
  - `knowledge-base/` — architecture, APIs, runtime flow relevant to the change
37
+ - `.engineering-intelligence/aidlc/` — active AI-DLC state, plan, audit, open questions, construction units
37
38
  - `.engineering-intelligence/memory/` — decisions, constraints, patterns that apply
38
39
  - `.engineering-intelligence/context/` — module map, critical paths, dangerous areas near the change
39
40
  - `.engineering-intelligence/graph/` — dependency and service relationships
@@ -75,14 +76,31 @@ Before any code edit, write `.engineering-intelligence/reports/IMP-XXX-<summary>
75
76
 
76
77
  ### 3. Implement the Change
77
78
 
79
+ - Select the adaptive delivery mode inside the existing Engineering Intelligence workflow:
80
+ - Standard Agile delivery for normal feature, bugfix, update, and refactor work
81
+ - Adversarial delivery for auth, payment, public API, secrets, or compliance-sensitive work
82
+ - TDD delivery for high-reliability business rules and service contracts
83
+ - Design-first delivery for migrations, new architecture, and broad system boundaries
84
+ - Hypothesis debugging for unknown-cause defects
85
+ - Update Agile artifacts when product behavior is in scope:
86
+ - `.engineering-intelligence/aidlc/agile/product-backlog.md`
87
+ - `.engineering-intelligence/aidlc/agile/sprint-plan.md`
88
+ - `.engineering-intelligence/aidlc/agile/acceptance-criteria.md`
89
+ - `.engineering-intelligence/aidlc/agile/definition-of-ready.md`
90
+ - `.engineering-intelligence/aidlc/agile/definition-of-done.md`
91
+ - Update `.engineering-intelligence/aidlc/execution-plan.md` and `.engineering-intelligence/aidlc/aidlc-state.md`
92
+ - Split broad changes into construction units and keep `.engineering-intelligence/aidlc/construction/cross-unit-discoveries.md` current
78
93
  - Edit only the files necessary for the request
79
94
  - Follow existing coding patterns from `.engineering-intelligence/memory/coding-patterns.md`
95
+ - Read conventions from `knowledge-base/16-conventions.md` and `.engineering-intelligence/memory/coding-patterns.md` — match naming patterns, import style, error handling patterns, and code structure
96
+ - If conventions document is missing or outdated, run `convention-detector` first
80
97
  - Respect architectural boundaries from `.engineering-intelligence/memory/architecture-decisions.md`
81
98
  - Consult `dangerous-areas.md` before modifying flagged code
82
99
 
83
100
  ### 4. Add/Update Tests
84
101
 
85
102
  - Add tests proportional to the change risk level
103
+ - Map each acceptance criterion to at least one automated test, manual verification step, or explicitly recorded unavailable check
86
104
  - For `bugfix`: add a regression test reproducing the original issue
87
105
  - For `feature`: add unit tests and integration tests for the new behavior
88
106
  - For `architecture`/`security`: add boundary and negative-path tests
@@ -91,6 +109,8 @@ Before any code edit, write `.engineering-intelligence/reports/IMP-XXX-<summary>
91
109
  ### 5. Validate
92
110
 
93
111
  - Run linters, type checks, and test suites available in the project
112
+ - Use environmental backpressure: analyze failed diagnostics, fix, and rerun the relevant command until it passes or a blocker is recorded
113
+ - Write `.engineering-intelligence/aidlc/construction/<unit>/build-and-test/build-and-test-summary.md` for non-trivial units
94
114
  - **Never claim validation passed unless it actually ran and passed**
95
115
  - Record partial or failed validation honestly
96
116
 
@@ -102,6 +122,8 @@ Use `incremental-sync-engine` to update only affected artifacts:
102
122
  - Context maps if module/service topology changed
103
123
  - Graph nodes/edges if dependencies or services changed
104
124
  - Event guidance if API/schema/auth contracts changed
125
+ - AI-DLC lifecycle artifacts if state, plan, NFRs, ADRs, operations readiness, or unit discoveries changed
126
+ - Agile artifacts if backlog, story status, acceptance criteria, Ready/Done gates, or retrospective learning changed
105
127
 
106
128
  ### 7. Record Change
107
129
 
@@ -151,6 +173,7 @@ Summarize to the user:
151
173
  - Affected systems and services
152
174
  - Synchronized intelligence artifacts
153
175
  - Unresolved risks or follow-ups
176
+ - Final AI-DLC breadcrumb: `AI-DLC: <phase> -> <stage> -> <status>`
154
177
 
155
178
  ## Quality Gates
156
179
 
@@ -158,11 +181,17 @@ Summarize to the user:
158
181
  - [ ] All changed behavior has corresponding test coverage
159
182
  - [ ] Validation was actually executed (not just claimed)
160
183
  - [ ] Only affected intelligence artifacts were updated
184
+ - [ ] AI-DLC state, execution plan, and unit artifacts are current for non-trivial work
185
+ - [ ] Story meets Definition of Ready before implementation starts
186
+ - [ ] Story meets Definition of Done before final report
187
+ - [ ] Acceptance criteria are mapped to validation evidence
188
+ - [ ] Environmental backpressure was used for validation failures
161
189
  - [ ] Change record references the correct impact report
162
190
  - [ ] High-risk changes went through review gate
191
+ - [ ] Generated code follows detected project conventions (naming, imports, structure)
163
192
 
164
193
  ## Cross-References
165
194
 
166
195
  - Depends on: `initialize-intelligence-skill` (prerequisite), `change-detection-engine`, `impact-analysis-engine`, `graph-engine`
167
196
  - Uses during execution: `testing-intelligence-engine`, `incremental-sync-engine`, `change-history-engine`
168
- - Optional: `engineering-change-review` (for high-risk), `refactoring-planner` (for refactors)
197
+ - Optional: `engineering-change-review` (for high-risk), `refactoring-planner` (for refactors), `convention-detector` (for convention compliance)
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: environmental-backpressure-engine
3
+ description: Drives compiler, linter, type-check, test, security, and architecture feedback loops until objective validation passes or blockers are recorded.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # Environmental Backpressure Engine
8
+
9
+ Use this skill whenever code is generated or modified. The environment, not subjective inspection alone, supplies the feedback loop.
10
+
11
+ ## Procedure
12
+
13
+ 1. Detect available validation commands from package manifests, build files, CI config, and README instructions.
14
+ 2. Prefer narrow checks first, then broaden:
15
+ - formatter or static syntax check
16
+ - type check or compile
17
+ - targeted tests
18
+ - full test suite
19
+ - linter
20
+ - security or architecture scanner when relevant
21
+ 3. Run the smallest relevant command that can expose the current risk.
22
+ 4. Capture raw diagnostics in the active unit's `build-and-test/` artifact.
23
+ 5. Fix failures and rerun the relevant check.
24
+ 6. Stop only when checks pass, are unavailable, or a blocker is recorded with evidence.
25
+
26
+ ## Build And Test Summary
27
+
28
+ Write `.engineering-intelligence/aidlc/construction/<unit>/build-and-test/build-and-test-summary.md`:
29
+
30
+ ```markdown
31
+ # Build And Test Summary: <unit>
32
+
33
+ ## Commands
34
+ - `<command>`: <passed|failed|unavailable|skipped> — <why>
35
+
36
+ ## Failures And Corrections
37
+ - <diagnostic summary> -> <fix applied> -> <rerun result>
38
+
39
+ ## Coverage / Performance
40
+ - <available metrics or Not detected>
41
+
42
+ ## Residual Risk
43
+ - <remaining risks, blockers, or manual verification>
44
+ ```
45
+
46
+ ## Rules
47
+
48
+ - Never report validation as passed unless the command actually ran and passed.
49
+ - Do not hide failing output. Summarize it and keep enough detail for reproduction.
50
+ - Human review begins after local backpressure is exhausted, not before.
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: git-intelligence-engine
3
+ description: Extracts structural intelligence from git history — hotspot analysis, ownership mapping, change coupling, velocity tracking, and drift detection. Feeds graph intelligence and impact analysis with git-derived edges.
4
+ version: 3.0.0
5
+ ---
6
+
7
+ # Git Intelligence Engine
8
+
9
+ Extract actionable intelligence from git history to reveal hidden dependencies, ownership patterns, and codebase evolution trends.
10
+
11
+ ## Inputs
12
+
13
+ - Repository root path
14
+ - Mode: `full` (analyze complete history) or `incremental` (analyze since last run)
15
+ - Optional: time window (e.g., last 90 days, last 6 months)
16
+ - Optional: branch filter (specific branches to analyze)
17
+
18
+ ## Procedure
19
+
20
+ 1. **Collect History** — Extract commit log with file-level diffs, authors, timestamps, and branch metadata. For `incremental` mode, scope to commits since the last recorded analysis timestamp.
21
+
22
+ 2. **Hotspot Analysis** — Identify the most frequently changed files and directories:
23
+
24
+ | Metric | Description |
25
+ |---|---|
26
+ | Change frequency | Number of commits touching each file |
27
+ | Churn rate | Lines added + deleted per file over the time window |
28
+ | Complexity trend | Whether hotspot files are growing in size/complexity |
29
+ | Bug correlation | Commits linked to bugfix keywords touching each file |
30
+
31
+ Rank files by composite hotspot score (frequency × churn × bug correlation).
32
+
33
+ 3. **Ownership Mapping** — Determine contributor ownership per module:
34
+
35
+ | Field | Description |
36
+ |---|---|
37
+ | Primary owner | Contributor with most commits to the module |
38
+ | Secondary owners | Other significant contributors (>10% of commits) |
39
+ | Bus factor | Number of contributors with meaningful knowledge |
40
+ | Last active | Most recent commit date per contributor per module |
41
+ | Orphaned modules | Modules where all significant contributors are inactive (>90 days) |
42
+
43
+ 4. **Change Coupling Analysis** — Identify files that always change together:
44
+
45
+ | Metric | Description |
46
+ |---|---|
47
+ | Co-change frequency | Number of commits where both files are modified |
48
+ | Coupling strength | Co-change frequency / total changes of either file |
49
+ | Confidence | `verified` if coupling > 0.7, `inferred` if 0.4–0.7, `unknown` below |
50
+
51
+ Flag high-coupling pairs that span module boundaries — these indicate hidden dependencies not visible in import graphs.
52
+
53
+ 5. **Velocity Tracking** — Measure change rate per module per time period:
54
+
55
+ | Metric | Description |
56
+ |---|---|
57
+ | Commits per week | Average commit frequency per module |
58
+ | Active contributors | Unique contributors per module per period |
59
+ | Acceleration | Whether velocity is increasing, stable, or declining |
60
+ | Staleness | Modules with zero commits in the analysis window |
61
+
62
+ 6. **Drift Detection** — Identify branches that have diverged significantly:
63
+
64
+ | Metric | Description |
65
+ |---|---|
66
+ | Divergence score | Number of commits ahead/behind between branch pairs |
67
+ | Conflict potential | Files modified in both branches |
68
+ | Merge complexity | Estimated effort to reconcile (based on overlapping changes) |
69
+ | Stale branches | Branches with no commits in >30 days |
70
+
71
+ 7. **Feed Graph Intelligence** — Write git-derived edges to `.engineering-intelligence/graph/`:
72
+ - Add `co-changes-with` edges to `dependency-graph.json` for verified change-coupled pairs
73
+ - Add `owned-by` metadata to graph nodes based on ownership mapping
74
+ - Mark edge confidence based on analysis evidence
75
+
76
+ 8. **Generate Report** — Write `.engineering-intelligence/reports/GIT-intelligence.md` with all findings, ranked by actionability.
77
+
78
+ ## Output Format
79
+
80
+ Write `.engineering-intelligence/reports/GIT-intelligence.md`:
81
+
82
+ ```markdown
83
+ # Git Intelligence Report
84
+
85
+ ## Meta
86
+ - Generated: <ISO timestamp>
87
+ - Mode: full | incremental
88
+ - Time window: <start> to <end>
89
+ - Commits analyzed: <count>
90
+
91
+ ## Hotspots
92
+ | Rank | File | Change Freq | Churn | Bug Correlation | Score |
93
+ |---|---|---|---|---|---|
94
+ | 1 | path/to/file.ts | 47 | 1,240 | 8 | 95.2 |
95
+
96
+ ## Ownership Map
97
+ | Module | Primary Owner | Bus Factor | Orphaned |
98
+ |---|---|---|---|
99
+ | src/auth/ | alice | 3 | No |
100
+
101
+ ## Change Coupling
102
+ | File A | File B | Co-changes | Strength | Cross-module |
103
+ |---|---|---|---|---|
104
+ | src/api/users.ts | src/db/user-repo.ts | 23 | 0.82 | Yes |
105
+
106
+ ## Velocity
107
+ | Module | Commits/Week | Trend | Staleness |
108
+ |---|---|---|---|
109
+ | src/core/ | 12.3 | Accelerating | — |
110
+
111
+ ## Drift
112
+ | Branch | Divergence | Conflict Files | Stale |
113
+ |---|---|---|---|
114
+ | feature/payments | +47 / -12 | 3 | No |
115
+
116
+ ## Graph Updates
117
+ - Edges added: <count>
118
+ - Nodes annotated: <count>
119
+
120
+ ## Evidence
121
+ - <file path citations>
122
+ ```
123
+
124
+ ## Rules
125
+
126
+ - Never fabricate git history — all metrics must derive from actual commit data
127
+ - Ownership mapping must not assume contributor activity from naming conventions alone
128
+ - Change coupling edges added to graphs must include evidence paths
129
+ - This capability is analytical only — it must not modify product code
130
+
131
+ ## Quality Gates
132
+
133
+ - [ ] All metrics cite commit SHAs or date ranges as evidence
134
+ - [ ] Hotspot ranking uses composite scoring (not single-metric)
135
+ - [ ] Ownership includes bus factor and orphaned module flags
136
+ - [ ] Change coupling distinguishes intra-module from cross-module pairs
137
+ - [ ] Graph edges added carry `confidence` and `evidence` fields
138
+ - [ ] Report ends with graph update summary
139
+
140
+ ## Cross-References
141
+
142
+ - Depends on: `graph-engine` (for writing git-derived edges)
143
+ - Used by: `impact-analysis-engine`, `graph-engine`
144
+ - Consumed by: `pr-intelligence-engine`
145
+
146
+ This capability is analytical only. It must not modify product code.