Skip to content
ccg-latent logo

CCG Latent Chain Mode

ccg-latent

Use this skill for multi-step development tasks. Latent Chain Mode reduces token usage by 70-80% through hidden-state reasoning with 4-phase workflow: analysis → plan → impl → review.

SKILL.md

Full skill instructions

CCG Latent Chain Mode

Token-efficient hidden-state reasoning for complex development tasks.

When to Use

MANDATORY for tasks with 2+ steps:

  • Bug fixes requiring code analysis
  • Feature implementations
  • Refactoring across files
  • Code reviews and audits

3 Quick Flows

FlowCommandUse Case
A/​latent-fixQuick fix 1-2 patches
B/​latent-featureMulti-file feature/​refactor
C/​latent-reviewCode review without edits

4-Phase Workflow

ANALYSIS ──► PLAN ──► IMPL ──► REVIEW
   🔍          📋        🔧        ✅

Phase 1: Analysis 🔍

  • Understand requirements
  • Identify hot spots (file:line)
  • Document constraints and risks

Phase 2: Plan 📋

  • Break into subtasks/​patches
  • Order by dependencies
  • Estimate complexity

Phase 3: Implementation 🔧

  • Apply patches with latent_apply_patch
  • Run guard_validate after each patch
  • Run testing_run_affected for verification

Phase 4: Review ✅

  • Verify all changes
  • Check against constraints
  • Complete task

Core Tools

latent_context_create    - Start new task context
latent_context_get       - Retrieve current context
latent_context_update    - Merge delta (changes only!)
latent_phase_transition  - Move to next phase
latent_apply_patch       - Apply code changes (unified diff)
latent_complete_task     - Mark task complete
latent_status            - Get module status

Output Format

Human-readable format in editor:

🔍 [analysis] <title>
<1-2 sentence description>

[Hot Spots] file:line, file:line
[Decisions] D001: ..., D002: ...
[Risks] if any

---

📋 [plan] <N patches/​tasks>

[Patches]
1. file:line - description
2. file:line - description

---

🔧 [impl] Patch N/​M: <name>
Applied: <count> | Tests: <status>

---

✅ [review] Complete
Files: N | Patches: M | Tests: passed

Context Delta Format

CRITICAL: Only send changes, never full context!

{
  "summary": "Brief description (max 200 chars)",
  "contextDelta": {
    "codeMap": { "hotSpots": ["src/​auth.ts:45"] },
    "decisions": [{ "id": "D001", "summary": "Use JWT", "rationale": "Industry standard" }],
    "risks": ["Token expiry handling"]
  },
  "actions": [
    { "type": "edit_file", "target": "src/​auth.ts", "description": "Fix token validation" }
  ]
}

Strict Rules

  1. Summary max 200 chars - No essays
  2. Delta only - Never repeat full context
  3. Decision IDs - D001, D002 for tracking
  4. Always complete - Don't leave contexts hanging
  5. Guard + Test - After every patch
  6. Phase icons - 🔍 📋 🔧 ✅

Example: Bug Fix Flow

User: "Fix the login timeout bug"

Claude:
1. latent_context_create({ taskId: "fix-login-timeout" })
2. 🔍 [analysis] Investigate login timeout
   [Hot Spots] src/​auth/​login.ts:145
   [Decisions] D001: Root cause is missing token refresh
3. latent_phase_transition({ toPhase: "plan" })
4. 📋 [plan] 2 patches
   1. src/​auth/​login.ts:145 - Add token refresh logic
   2. src/​auth/​login.ts:160 - Handle refresh errors
5. latent_phase_transition({ toPhase: "impl" })
6. latent_apply_patch({ target: "src/​auth/​login.ts", patch: "..." })
7. guard_validate({ code: "...", filename: "login.ts" })
8. latent_phase_transition({ toPhase: "review" })
9. ✅ [review] Complete - Files: 1 | Patches: 2 | Tests: passed
10. latent_complete_task({ summary: "Fixed login timeout with token refresh" })

Token Savings

TraditionalLatent ModeSavings
Full context each turnDelta only70-80%
Verbose explanationsStructured output50-60%
Repeated codeReferences40-50%

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View