ccppccpp home
Browse the documentation

Plugins · CCPP PQL

Identifier cheatsheet

Every PQL keyword, HOW directive, connector, registered identifier, reference sigil and value type on one page.

Keywords and identifiers are case-sensitive. ccpp pql registry prints the same tables for the installed version (--json for tools).

Sigils and values

WrittenMeaningExample
$First character of the prompt: PQL mode$ FROM @src { … }
@pathPath reference (Claude Code's @ mention), never a string@packages/pql, @"my dir", @~/notes
!idCPO policy reference, kebab-case!ts-no-any;
#id(…)Function call, kebab-case#add-features("Lexer", 3);
{{ path }}Interpolation of a value path{{ params.name }}, {{ vars.i }}
"…"String on one line; escapes \" \\ \n \t \r \{ \} \u{1F600}ADD "A typed parser";
250Number; bounds are integers without signLIMIT FILE TO 250 LINES;
[a, b]List (function arguments, FOR)["a", "b"]
true false nullLiterals (function arguments)
// … /* … */Comments
; or { }Every statement ends with one of them

# and ! inside a string are text: ADD "Document #add-features"; calls nothing.

Keywords

RoleKeywordParametersEnds with
ScopeFROM1 existing directory @ref; (root header) or block
ScopeMAKE1 new directory @ref; (root header) or block
ObjectiveADD REMOVE MODIFY REFACTOR SKIP1 to N descriptions;
ObjectiveCONTINUE0 or 1 description;
ConditionIF HAPPEN IF NOT HAPPENexactly 1 descriptionblock
ConditionELSE IF HAPPEN ELSE IF NOT HAPPENexactly 1 descriptionblock
ConditionELSEnoneblock
StopSESSION SUCCESS1 to N criteria, root scope only;
StopSTOP WHEN ASK WHENexactly 1 description;
HOWHOWnone, holds directives onlyblock
ControlFOR v IN RANGE(a, b), FOR v IN listloop variableblock

A description is a non-blank string. Several descriptions after one keyword are as many objectives or criteria.

HOW directives

DirectiveStrengthConnectors
STRUCTURE BY "…", STYLE "…", ERRORS USING "…", STATE "…", ASYNC USING "…", TEST USING "…", INTEGRATE VIA "…", SPLIT WHEN "…"constraint
PATTERN "…", …, DOCUMENT "…", …constraint
BOUNDARY target EXPOSES "symbol", …constraintEXPOSES, CONSUMES
ISOLATE target FROM target, …constraintFROM
CONTRACT target ACCEPTS "type", … RETURNS "type"constraintACCEPTS (optional), RETURNS
COLOCATE target WITH targetconstraintWITH
IMPLEMENT target USING "technique"constraintUSING
LIMIT category TO n unitconstraintTO
DEPTH MAX nconstraint
COMPLEXITY metric MAX nconstraintMAX
NAMING category conventionconstraint
MATCH aspect OF @sourceconstraintOF
PACKAGES NO_NEW, PACKAGES STANDARD_ONLY, PACKAGES ALLOW "name", …constraintNO_NEW, STANDARD_ONLY, ALLOW
COMPATIBILITY mode WITH baselineconstraintWITH
FOLLOW principle, …principle
PREFER "a" OVER "b"preferenceOVER
REUSE @path, …preference

A target is a string or an @ reference; a baseline is an @ reference or a string.

Registered identifiers

DomainIdentifiersUsed by
limit-categoryFILE, FUNCTION, CLASS, PARAMETERSLIMIT
limit-unitLINES, B, KB (1,000 bytes), KIB (1,024 bytes), METHODSLIMIT
naming-categoryVARIABLES, FUNCTIONS, CLASSES, INTERFACES, CONSTANTS, FILESNAMING
naming-conventioncamelCase, PascalCase, snake_case, UPPER_SNAKE_CASE, kebab-caseNAMING
match-aspectSTYLE, NAMING, STRUCTURE, PATTERNSMATCH
principleKISS, DRY, YAGNI, SOLIDFOLLOW
metricCYCLOMATIC (McCabe, profile cyclomatic-mccabe-v1)COMPLEXITY
compatibility-modeBACKWARD, RUNTIMECOMPATIBILITY

Units per LIMIT category:

CategoryUnits
FILELINES, B, KB, KIB
FUNCTIONLINES
CLASSLINES, METHODS
PARAMETERSnone: LIMIT PARAMETERS TO 4;

Function definitions

Field or nameValues
kindfragment (default), how, program
Parameter typesstring, NonEmptyString, integer, number, boolean, array, PathRef, ExistingPathRef, ExistingDirectoryRef, NewDirectoryRef, any identifier domain
Constraintsminimum, maximum, minLength, maxLength, enum, items
Reserved namesparams, vars

Diagnostic codes

Codes read PQL- + a category letter + a number, such as PQL-S005. ccpp pql diagnostics lists all of them.

LetterStage
Ssyntax
Ddocument structure
Ttypes and cardinality
Ccondition chains
Pplacement
HHOW semantics and conflicts
Ocontradictions between objectives
R@ resolution
Ffunctions
Xpolicy references