- 1. Feature Context
- 2. Actor Flows (CDSL)
- 3. Processes / Business Logic (CDSL)
- 4. States (CDSL)
- 5. Definitions of Done
- 6. Implementation Modules
- 7. Acceptance Criteria
-
p2- ID:cpt-cypilot-featstatus-developer-experience
-
p2-cpt-cypilot-feature-developer-experience
Enhances developer productivity with environment health checks, template QA, git pre-commit hooks, and shell completions. The self-check command validates that kit examples pass their own template constraints — ensuring kit integrity. The doctor command checks the development environment for required dependencies and configuration issues.
Reduces friction in daily Cypilot usage. doctor catches environment issues before they cause cryptic errors. self-check catches kit regressions (template/example drift). Hooks enforce validation in CI. Completions improve CLI discoverability. Addresses PRD requirements for template QA (cpt-cypilot-fr-core-template-qa), environment diagnostics (cpt-cypilot-fr-core-doctor), pre-commit hooks (cpt-cypilot-fr-core-hooks), and shell completions (cpt-cypilot-fr-core-completions).
| Actor | Role in Feature |
|---|---|
cpt-cypilot-actor-user |
Runs cpt doctor, cpt self-check, installs hooks/completions |
cpt-cypilot-actor-ai-agent |
Invokes cpt resolve-vars and cpt info to resolve template variables for kit file substitution |
cpt-cypilot-actor-ci-pipeline |
Runs validation via pre-commit hooks |
- PRD: PRD.md —
cpt-cypilot-fr-core-template-qa,cpt-cypilot-fr-core-doctor,cpt-cypilot-fr-core-hooks,cpt-cypilot-fr-core-completions - Design: DESIGN.md —
cpt-cypilot-component-validator - Dependencies:
cpt-cypilot-feature-traceability-validation
-
p2- ID:cpt-cypilot-flow-developer-experience-doctor
Actor: cpt-cypilot-actor-user
Success Scenarios:
- User runs
cpt doctor→ all checks pass, environment is healthy
Error Scenarios:
- Python version too old → FAIL with version requirement
ghCLI not installed → WARN (optional dependency)- Config corrupted → FAIL with remediation hint
Steps:
-
p2- User invokescpt doctor-inst-user-doctor
-
p2- Check Python version (≥ 3.11) -inst-check-python
-
p2- Check git availability -inst-check-git
-
p2- CheckghCLI availability and authentication -inst-check-gh
-
p2- Check agent installations -inst-check-agents
-
p2- Check config integrity (core.toml, artifacts.toml parseable) -inst-check-config
-
p2- RETURN health report with pass/fail per check -inst-return-health
-
p1- ID:cpt-cypilot-flow-developer-experience-self-check
Actor: cpt-cypilot-actor-user
Success Scenarios:
- User runs
cpt self-check→ all kit examples validate against their templates/constraints - User runs
cpt self-check --kit sdlc→ only SDLC kit checked
Error Scenarios:
- Example fails template validation → FAIL with specific heading/constraint mismatch details
- constraints.toml missing → ERROR with hint to regenerate
Steps:
- -
p1- User invokescpt self-check [--kit K] [--verbose]-inst-user-self-check - -
p1- Load artifacts registry and kit metadata -inst-load-registry -
p1- FOR EACH kit (or filtered by--kit) -inst-for-each-kit
-
p1- Load constraints.toml for the kit -inst-load-constraints
-
p1- FOR EACH artifact kind in kit -inst-for-each-kind
-
p1- Validate template against heading constraints -inst-validate-template
-
p1- Validate example against heading constraints -inst-validate-example
-
p1- Check template/example consistency -inst-check-consistency
- -
p1- RETURN self-check report with per-kind results -inst-return-self-check
-
p3- ID:cpt-cypilot-flow-developer-experience-hooks
Steps:
-
p3- User invokescpt hook install-inst-install-hook
-
p3- Write pre-commit hook script to.git/hooks/pre-commit-inst-write-hook
-
p3- Hook runscpt validateon staged artifact files -inst-hook-validate
-
p1- ID:cpt-cypilot-flow-developer-experience-toc
Actor: cpt-cypilot-actor-user
Success Scenarios:
- User runs
cpt toc <files>→ TOC generated/updated in each file - User runs
cpt toc --dry-run <files>→ changes shown without writing
Error Scenarios:
- File not found → ERROR per file
- Post-generation validation fails → VALIDATION_FAIL with details
Steps:
- -
p1- User invokescpt toc <files> [--max-level N] [--indent N] [--dry-run] [--skip-validate]-inst-toc-gen-parse-args - -
p1- FOR EACH file -inst-toc-gen-foreach-file- -
p1- Process file: extract headings, generate TOC, insert/update between<!-- toc -->markers -inst-toc-gen-process - -
p1- IF not dry-run and not skip-validate, validate generated TOC -inst-toc-gen-validate
- -
- -
p1- RETURN JSON:{status, files_processed, results}-inst-toc-gen-return
Supporting:
- -
p1- Imports and module setup for toc command -inst-toc-gen-imports - -
p1- Human-friendly formatter for toc command output -inst-toc-gen-format
-
p1- ID:cpt-cypilot-flow-developer-experience-resolve-vars
Actor: cpt-cypilot-actor-ai-agent
Success Scenarios:
- Agent runs
cpt resolve-vars→ all template variables resolved to absolute paths - Agent runs
cpt resolve-vars --kit sdlc→ only SDLC kit variables returned - Agent runs
cpt info→variablesdict included in output for automatic resolution during Protocol Guard
Error Scenarios:
- No project root → ERROR with searched path
- Cypilot not initialized → ERROR with project_root
- Kit not found (with
--kit) → ERROR with available kits list
Steps:
- -
p1- User/agent invokescpt resolve-vars [--root P] [--kit K] [--flat]-inst-resolve-vars-parse-args - -
p1- Discover project root and cypilot directory -inst-resolve-vars-discover - -
p1- Load core.toml for kit resource bindings -inst-resolve-vars-load-core - -
p1- Collect system variables (cypilot_path, project_root) -inst-resolve-vars-system - -
p1- FOR EACH kit with resources in core.toml -inst-resolve-vars-foreach-kit- -
p1- Resolve each resource binding to absolute path -inst-resolve-vars-resolve-binding
- -
- -
p1- Merge system + kit variables into flat dict -inst-resolve-vars-merge - -
p1- IF--kitfilter, restrict to that kit -inst-resolve-vars-filter-kit - -
p1- RETURN JSON:{status, system, kits, variables}-inst-resolve-vars-return
Supporting:
- -
p1- Render resolved variables in human-friendlyinfooutput -inst-info-render-variables - -
p1- Human-friendly flat variable formatter -inst-resolve-vars-human-flat - -
p1- Human-friendly structured variable formatter -inst-resolve-vars-human-structured
-
p3- ID:cpt-cypilot-flow-developer-experience-completions
Steps:
-
p3- User invokescpt completions install-inst-install-completions
-
p3- Detect shell (bash/zsh/fish) and write completion script -inst-write-completions
-
p2- ID:cpt-cypilot-algo-developer-experience-doctor
-
p2- Checkpython3 --version≥ 3.11 -inst-check-python-version
-
p2- Checkgit --versionavailable -inst-check-git-version
-
p2- Checkgh --versionandgh auth status-inst-check-gh-status
-
p2- Check Cypilot installation:.core/,.gen/,config/exist -inst-check-installation
-
p2- Attempt to parsecore.tomlandartifacts.toml-inst-check-parseable
-
p2- Checkralphexavailability: discover onPATHor via persistedcore.toml[integrations.ralphex].executable_path; if found, runralphex --versionto verify compatibility; if missing, WARN with installation guidance (Homebrew,go install, binary releases) — ralphex is optional, so missing is WARN not FAIL (seecpt-cypilot-adr-ralphex-delegation-skill) -inst-check-ralphex
-
p1- ID:cpt-cypilot-algo-developer-experience-self-check
-
p1- Load constraints.toml for each kit -inst-load-kit-constraints
- -
p1- For each artifact kind, locate template and example paths -inst-locate-files - -
p1- Validate template headings match constraints heading contract -inst-validate-headings -
p1- Validate example headings match constraints heading contract -inst-validate-example-headings
-
p1- Check that template defines all required ID kinds from constraints -inst-check-id-kinds
-
p1- ID:cpt-cypilot-algo-developer-experience-resolve-vars
- -
p1- Collect system variables: cypilot_path (adapter dir), project_root -inst-collect-system-vars - -
p1- For each kit in core_data.kits, extract resources dict -inst-extract-kit-resources - -
p1- For each resource binding, resolve relative path to absolute via adapter_dir -inst-resolve-binding-path - -
p1- Merge system + all kit variables into flat dict (kit IDs are globally unique) -inst-merge-flat-dict - -
p1- Return structured result: {system, kits, variables} -inst-return-structured
No feature-specific state machines. Self-check is stateless (run → report).
-
p2- ID:cpt-cypilot-dod-developer-experience-doctor -
-
p2-cpt doctorchecks Python, git, gh CLI, config integrity, and optionalralphexavailability -
-
p2- Each check reports pass/fail/warn with actionable remediation -
-
p2- Exit code 0 if all checks pass, 2 if any fail (WARN-only does not fail)
-
p1- ID:cpt-cypilot-dod-developer-experience-self-check -
-
p1-cpt self-checkvalidates all kit examples against their templates/constraints -
-
p1---kitflag filters to a single kit -
-
p1- Reports per-kind pass/fail with specific issues -
-
p1- Integrated intocpt validateas a fail-fast pre-check
-
p1- ID:cpt-cypilot-dod-developer-experience-resolve-vars -
-
p1-cpt resolve-varsresolves all template variables to absolute paths -
-
p1---kitflag filters to a single kit -
-
p1---flatflag outputs plain variable→path dict -
-
p1-cpt infoincludesvariablesdict in output for Protocol Guard -
-
p1- System variables (cypilot_path, project_root) always present -
-
p1- Kit resource bindings resolved from core.toml registrations
-
p3- ID:cpt-cypilot-dod-developer-experience-hooks -
-
p3-cpt hook installwrites pre-commit hook -
-
p3-cpt hook uninstallremoves pre-commit hook -
-
p3- Hook only validates staged artifact files
-
p3- ID:cpt-cypilot-dod-developer-experience-completions -
-
p3-cpt completions installwrites shell-appropriate completion script -
-
p3- Supports bash, zsh, and fish
| Module | Path | Responsibility |
|---|---|---|
| Self-Check Command | skills/.../commands/self_check.py |
Kit example validation against templates/constraints |
| TOC Command | skills/.../commands/toc.py |
CLI wrapper for TOC generation |
| TOC Utils | skills/.../utils/toc.py |
Unified TOC generation, anchor slugs, code block awareness |
| Resolve Vars Command | skills/.../commands/resolve_vars.py |
Template variable resolution to absolute paths |
-
cpt self-checkvalidates kit integrity and reports per-kind results -
cpt resolve-varsresolves all template variables to absolute paths -
cpt infoincludesvariablesin output for agent variable resolution -
cpt doctorreports environment health with pass/fail/warn per check (including optionalralphexavailability) - Pre-commit hooks enforce validation on staged artifacts
- Shell completions work for all documented commands