/dvera:ct-setup-projectfrom dvera
Use this skill to create the CT toolchain and project for the host or conversion path, and to apply user include paths and defines as compile flags.
Ships in dvera. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Primary request: Use this skill when creating a CT project and toolchain with either a host or conversion toolchain.
Entry:
conversion: status is conf_generatedhost: status is pending or missing, toolchain_mode=host, and toolchain_mode_user_confirmed=true
Input: state.json -> shared toolchain_mode, source_info, project_inputs; for conversion, also top-level conf_path, artifacts.meta_ini_path, artifacts.meta_info_path, env_profile.resolved_vars, and env_profile.system_headers (must already be populated as a non-empty list in Phase 1)
Output: state.json (status=project_created, ct_resources.*, and either host_toolchain or fingerprints)
Execution mode: In-memory state when called through ct-orchestrator / one-time state.json read in standalone mode
Standalone guard:toolchain_mode is missing or unresolved -> stop immediately and tell the user to run ct-init-project first to complete project preparationconversion but status is not conf_generated -> stop immediately and tell the user to run ct-init-project first to complete project preparationconversion but env_profile.system_headers is missing or empty -> stop immediately and tell the user to run ct-init-project first to complete project preparation. system_headers must not be emptyhost but pre-Phase3 fields (toolchain_mode_evidence, toolchain_mode_user_confirmed, source_info, project_inputs) are missing -> stop immediately and tell the user to run ct-init-project first to complete project preparationconversion, toolchain creation is impossible without the Phase 2 artifacts (top-level conf_path, artifacts.meta_ini_path, artifacts.meta_info_path)
Precondition: Use the bootstrap variables acquired in Phase 0. In end-to-end entry, ct-init-project prepares them. In resume entry, ct-orchestrator prepares them. Even in standalone mode, run the bootstrap procedure below first.state.json, compiler_info.json, observations.jsonl, .conf, .ini, and .info.json.dump or json.dumps.stdout, stderr, pipes, or redirects, handle everything as UTF-8.python -c. When paths, JSON, and Python code are nested in one string, encoding and escaping failures become much more likely.state.json, JSON payloads, and logs or metadata as absolute paths, and normalize to / when it is safe to do so./ normalization for paths passed to external process argv. Use argv lists by default, and only use / normalization when the target tool is known to accept it safely.LF as the default line ending for newly created internal management files such as state.json, compiler_info.json, and observations.jsonl. Preserve existing line endings when editing an existing file.json.dump(..., ensure_ascii=False) with tempfile.NamedTemporaryFile(delete=False, encoding="utf-8") or tempfile.gettempdir(), then pass it as ct_tool.py call ... --json "@{path}".
@- stdin only as a secondary input channel.ConvertTo-Json is a Windows-only auxiliary option; Bash heredoc/cat examples must not be the default payload path.argv lists over one-line string payloads.ct_create_toolchain, patch only the returned toolchainId into the project payload temporary JSON; do not split this into two persistent helper scripts such as phase3_payload.py and add_tc_id.py.toolchain_mode first and never mix the host and conversion write scopes.sourceFiles from source_info.source_paths before calling ct_create_project.conversion, validate top-level conf_path, artifacts.meta_ini_path, and artifacts.meta_info_path as absolute paths before creating the toolchain.ct_set_compile_flags input only from project_inputs.include_paths.user and project_inputs.defines.conf, ini, info, fingerprints) in host mode.ct_create_project with only sourceDir and omit sourceFiles in conversion mode.systemHeaders or put system headers back into compileFlags.compiler_info.include_paths.system as the canonical source for ct_set_compile_flags.selected_source_files is not fixed yet, stop and confirm.conversion, if IDE variable path resolution is incomplete or the source directory itself is invalid, stop and confirm.if toolchain_mode == "host":
write only the host toolchain selection result
ct_create_project(..., sourceFiles=[...], toolchainId=host_id)
else:
validate absolute conf/ini/info paths
ct_create_toolchain(...)
ct_create_project(..., sourceFiles=[...], toolchainId=created_id)
toolchain_mode and toolchain_mode_user_confirmed are fixed.sourceFiles is fixed in either selected_source_files or source_info.source_paths.host or conversion, will run and which state write set is allowed in that branch.conversion, confirm that top-level conf_path and the artifacts.conf_path mirror point to the same absolute path.project_inputs.*.Standalone bootstrap procedure:
bootstrap.ct_home exists in state.json, use that value.
{ctHome}/python/python.exe exists. Linux/Mac: {ctHome}/python/python3 existsctTool candidate can be found with glob({ctHome}/plugins/*/scripts/ct_tool.py)bootstrap.ct_home is missing or validation fails, check the OS-specific default installation path once.C:\Program Files\Suresoft\CT 2026$HOME/Suresoft/CT 2026ctHome with the standard prompt below.{ctHome}/python/python.exe exists. Linux/Mac: {ctHome}/python/python3 existsctTool candidate can be found with glob({ctHome}/plugins/*/scripts/ct_tool.py)ctHome with the standard prompt below.
The CT installation could not be verified. Provide the installation path to continue.
[Installation check] • Checked CT installation path: {ctHome or "not configured"} • Requirement: CT 2026.06 or later • Note: A valid CT license is required to run CT.
[If CT is already installed] • Please provide the full path to the CT installation folder. Example: C:\Program Files\Suresoft\CT 2026
[If CT is not installed] • Product and installation support: [email protected]
2. `ctPython` candidate: Windows -> `{ctHome}/python/python.exe`, Linux/Mac -> `{ctHome}/python/python3`
3. `ctTool` candidate: `glob({ctHome}/plugins/*/scripts/ct_tool.py)`
4. **Workspace selection** (before Bridge startup)
```bash
{ctPython} {ctTool} env
Read {baseDir}/workspaces.ctson from the returned baseDir and look up the current CWD entry.
Always confirm the workspace with the user. The user must always be able to type a new path — never present the candidate list as the only option.
Entry exists for CWD:
Build the candidate list as workspaces.ctson entries first, then append CT IDE history (ct_list_recent_workspaces) with exists=true after deduping by path.
"Select a workspace to use, or enter a new path:
- {path1} (projects: {projects1}) ← current default
- {path2} ... N. {recent_from_ct_ide} (CT IDE history) Or enter a new workspace path."
set-workspace call needed.{ctPython} {ctTool} set-workspace --workspace "<selected or entered path>"
No entry for CWD:
Call ct_list_recent_workspaces to surface candidates from the CT IDE history.
At least one entry with exists=true: Show the list with isLastUsed=true first, and always include an "enter a new path" option.
"No workspace is registered for this directory yet. Pick from your CT IDE history or enter a new path:
- {path1} ← most recently used in CT IDE
- {path2} ... Or enter a new workspace path."
No entries, all exists=false, or the call fails: ask directly with the standard prompt.
"Enter the Eclipse workspace path to use."
After the user picks or types a path:
{ctPython} {ctTool} set-workspace --workspace "<selected or entered path>"
Notes:
ct_list_recent_workspaces entries whose exists=false before showing.set-workspace automatically creates the CWD entry in workspaces.ctson for next time.ct_get_env to acquire pythonPath, skillResourceRoot, toolRoot, metaDir, and baseDir.
{ctPython} {ctTool} call ct_get_env --json "{}"
ctPython, ctTool, and skillResourceRoot from the returned values.sessionsBase is known, search for the latest session's state.json under {sessionsBase}/.
Bootstrap variables (acquired in Phase 0; end-to-end entry via ct-init-project, resume entry via ct-orchestrator, or by the standalone procedure above):
{ctPython}: Python executable path based on ct_get_env.pythonPath{ctTool}: ct_tool.py execution pathskillResourceRoot: autoconfig path from ct_get_env.skillResourceRootmetaDir: metadata path from ct_get_env.metaDirsessionsBase: workspace base path from {baseDir}/sessions/ (derived)CT functions (used in Phase 3):
ct_list_host_toolchains() - list registered host toolchainsct_list_toolchains(nameFilter?) - list all toolchains when name or description inspection is neededct_create_toolchain(toolchainName, confFilePath, infoFilePath, iniFilePath?, systemHeaders?) - infoFilePath is requiredct_create_project(sourceDir, sourceFiles, projectName, toolchainId?) - specify the toolchain with toolchainIdct_set_project_toolchain(projectName, toolchainId) - change the project toolchain for initial Phase 3 setup. Do not call this after ct_modify_toolchainct_get_project_settings(projectName) -> extract workingDirectoryct_set_compile_flags(projectName, compileFlags) - only for user includes and definesUser confirmation (required before entering Phase 3 - ask one by one in order):
init_inputs preset rule: if state.json.init_inputs exists, the two confirmations below are auto-decided from those values and not asked again.
init_inputs.source_files_preference="all", Confirmation 1 is auto-resolved as "select all". If "select", ask the user using the existing procedure.init_inputs.host_toolchain_id exists, Confirmation 2 auto-selects the candidate with that id.If there is only one source file: proceed with that file without asking.
If there are 2 or more source files: show the list from source_info.source_paths and ask the question below. Ask confirmation 2 only after this answer is received.
"Should I create the project with all of these source files ({N}), or would you like to select specific files only?"
source_info.source_paths as-isselected_source_files, then use that list for ct_create_project.sourceFilesProceed only after confirmation 1 is answered.
conversion mode.host mode, use the result of ct_list_host_toolchains().
host_toolchain inside state.Core sequence:
toolchain_mode, source_info, project_inputsconversion: resolve IDE variables by replacing ${CG_TOOL_ROOT} and similar placeholders in system_headers with values from env_profile.resolved_varsct_list_host_toolchains() to retrieve the existing host toolchain list
toolchainId directly (no ct_create_toolchain call)host_toolchainct_create_toolchain(toolchainName, confFilePath, infoFilePath, iniFilePath, systemHeaders) - confFilePath and infoFilePath must be absolute paths, and iniFilePath is required. Without it, the toolchain is registered as a host toolchain and analysis fails later.{session_id}_{HHmmss}_tc to avoid collisionstoolchainId from the return value for later stepstoolchainId into the existing project payload temporary file with a serializer. Do not create another helper script just to inject the ID.ct_create_project with explicit sourceFiles
sourceDir can accidentally include AI-generated files.{session_id}_{HHmmss}_projecttoolchainId: the ID returned or selected in step 2ct_resources.project_name or status=project_created, and do not bypass the failure with ct_set_project_toolchain, ct_analyze, or ct_create_test.ct_get_project_settings; it must succeed before Phase 3 is complete.
workingDirectory in ct_resources.working_directory.projectPath and sourceFiles only as in-memory completion checks. Do not store them in state.ct_set_compile_flags if project_inputs contains user includes or defines. Use only -I and -D formsstate.json only after all completion conditions pass
conversion, calculate fingerprintshost, record host_toolchainCanonical source for compile flags:
ct_set_compile_flags in Phase 3 must always come from project_inputs.include_paths.user and project_inputs.defines.compiler_info.include_paths.system and env_profile.system_headers are toolchain or system-header inputs. They are not the canonical source for ct_set_compile_flags.compileFlags type contract (must be a single string):
compileFlags parameter of ct_set_compile_flags is a single whitespace-separated string, as defined by the installed CT tool contract.{ "projectName": "...", "compileFlags": "-I\"C:/path/inc\" -D__MSP430F5500__" }
{ "projectName": "...", "compileFlags": ["-I\"C:/path/inc\"", "-D__MSP430F5500__"] }
@('-I"..."', '-D...') and passing it to ConvertTo-Json produces a JSON array. Build a whitespace-separated [string] from the start.
$userIncludes = ($project_inputs.include_paths.user | ForEach-Object { "-I`"$_`"" }) -join ' '
$defines = $project_inputs.defines -join ' '
$compileFlags = ($userIncludes, $defines | Where-Object { $_ }) -join ' ' # single string
compileFlags="$(printf -- '-I\"%s\" ' "${user_includes[@]}")$(printf '%s ' "${defines[@]}")".Forbidden:
systemHeaders-vmsp in compileFlags--include_path in ct_set_compile_flagscompileFlags as a JSON array. ct_set_compile_flags accepts only a single string; build it as a single string before calling the tool.conf/ini/info files directly without Phase 2. Metadata files are originals. Only use the outputs processed by Phase 2 (conf_merger.py) for the host environment, including corrected toolchain_kindValidation: If this is an IDE project session and project_inputs.defines is empty, a device macro may be missing. Ask the user to confirm.
Example host output:
{
"status": "project_created",
"ct_resources": {
"toolchain_id": "{selected host ID}",
"toolchain_name": "{selected host toolchain name}",
"project_name": "{session_id}_{HHmmss}_project",
"working_directory": "{abs_csdata_path}"
},
"host_toolchain": {
"toolchain_id": "{selected host ID}",
"name": "{selected host toolchain name}",
"selected_via": "ct_list_host_toolchains"
}
}
Example conversion output:
{
"status": "project_created",
"target_macros_path": "{abs_target_macros_path}",
"compiler_info_path": "{abs_compiler_info_path}",
"conf_path": "{abs_conf_path}",
"artifacts": {
"target_macros_path": "{abs_target_macros_path}",
"compiler_info_path": "{abs_compiler_info_path}",
"conf_path": "{abs_conf_path}",
"meta_ini_path": "{abs_ini_path}",
"meta_info_path": "{abs_info_path}"
},
"ct_resources": {
"toolchain_id": "{ct_create_toolchain return ID}",
"toolchain_name": "{session_id}_{HHmmss}_tc",
"project_name": "{session_id}_{HHmmss}_project",
"working_directory": "{abs_csdata_path}"
},
"fingerprints": {
"conf_hash": "sha256:{16hex}",
"ini_hash": "sha256:{16hex}"
}
}
Note: ct_resources allows only the four fields above: toolchain_id, toolchain_name, project_name, and working_directory. Do not include project_path, sourceFiles, project_settings_verified, or compile_flags.
Mode rules:
host mode, record host_toolchain and do not create conversion-only fields such as fingerprints or new Phase 2 artifacts.conversion mode, keep the Phase 2 artifacts (target_macros_path, compiler_info_path, conf_path, artifacts.*) and add ct_resources and fingerprints.fingerprints only in conversion mode. Hash values must include the sha256: prefix.Name-collision handling, regression reruns, and state validation are supplied with the installed CT/DVERA environment. Use its canonical documentation when available. If it is unavailable, do not create or modify a CT project; summarize the resolved project inputs and direct the user to [email protected].
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub suresofttechnologies/dvera-plugin --plugin dvera14 skills in this plugin
/ct-analysis-loopUse this skill during the CT project analysis phase to classify errors, repeat conf or toolchain fixes, and continue until analysis succeeds./ct-extract-macroUse this skill to extract the target compiler's compiler-default macros and build the shared environment analysis fields used during CT project preparation./ct-init-projectUse this skill to run the CT full pipeline from Phase 0 initial setup through macro extraction, conf and toolchain creation, analysis, testing, and observation-record collection, or to perform only the project-preparation stage./ct-kb-updateUse this skill to append single-change attempt results to `observations.jsonl`. It is called by `ct-init-project` or `ct-orchestrator` immediately after the CT-apply full pipeline completes./ct-make-confUse this skill to generate the conversion analysis `.conf` and toolchain metadata (`.ini`, `.info`) from extracted target macros and `compiler_info`, and to record fingerprints./ct-openLaunch CT with the current workspace. Use when you need to inspect the project visually in CT IDE during agent work.