Use when resolving LikeC4 errors—element not found, unknown kinds, invalid relationships, type mismatches, syntax failures. Provides root causes and fixes.
Diagnose the root cause, verify it quickly, then show the smallest correct fix.
Default response shape:
Prefer one corrected snippet over a long essay.
| Symptom | Root cause | Minimal fix |
|---|---|---|
Element not found | short name instead of FQN | use full FQN such as system.api |
Unknown kind | undeclared element kind | replace with exact shared kind from spec-*.c4 |
Invalid relationship kind | undeclared or wrong-scope relationship type | use model kinds (calls, async, reads, writes, uses) or proper deployment kinds |
Unknown relationship type: https in model {} | deployment type used in logical model | use -[calls]-> + technology 'HTTPS' |
| syntax error in relationship block | kind placed in properties block | move the kind into the arrow |
| dynamic view parent → child | containment shown as interaction | have the actor or peer call the component directly |
| unexpected elements in view | include pattern too broad | scope includes to the intended boundary |
instanceOf target not found | wrong FQN or wrong target type | point instanceOf to a real model container FQN |
| duplicate app edges in deployment | logical traffic restated in deployment | remove duplicate deployment edges and rely on inherited model relationships |
projects/shared/spec-*.c4 or the project summary// ❌ Wrong
api = Container_API 'API'
// ✅ Correct
api = Container_Api 'API' {
technology 'Node.js'
description 'Exposes the platform API.'
}
search-element// ❌ Wrong
instanceOf api
// ✅ Correct
instanceOf corePlatform.api
model {}technologytechnology// ❌ Wrong
webApp -[https]-> api 'Makes API requests'
// ✅ Correct
webApp -[calls]-> api 'Makes API requests' {
technology 'HTTPS'
}
calls, reads, or similar placed in the property block// ❌ Wrong
api -> service {
calls 'Fetch data'
}
// ✅ Correct
api -[calls]-> service 'Fetch data'
// ❌ Wrong
user -> system.webApp
system.webApp -> system.webApp.authModule
// ✅ Correct
user -> system.webApp.authModule 'Starts login'
system.webApp.authModule -> directoryService 'Validates credentials'
model {} and let instanceOf propagate it// ❌ Wrong
Prod.Web.webApp -[https]-> Prod.App.apiApp 'Browser traffic'
// ✅ Better
webApp -[calls]-> api 'Browser traffic' {
technology 'HTTPS'
}
rank sameOnly rank siblings that share the same parent context.
// ❌ Wrong
rank same ldapServer, devforge.postgresDb
// ✅ Correct
rank same devforge.api, devforge.database
rank hints, keep autoLayout, then add at most one obvious anchor if still needed// ❌ Wrong
include **
// ✅ Better
include corePlatform.*
include -> corePlatform.api
include corePlatform.api ->
Use an offline diagnosis path:
model, view, or deployment)projects/shared/SPEC_CHEATSHEET.md and projects/shared/spec-*.c4read-project-summary, find-relationships, search-element)model {}Return a short diagnosis with the root cause, the verification step, and a corrected snippet ready to paste.