Skip to content

context4ai/workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c4a-workflow

中文文档

A Claude Code plugin for knowledge-graph-driven development (KGDD). Models product requirements (PRD) and implementation plans (Plan) as structured Node/Edge/Fact graphs, enabling AI Agents to work with full spec traceability — from user stories to source code — with automated review, multi-Agent execution, testing, visualization, and a built-in design system.

Best for Node.js projects under ~200K lines of code. Works for greenfield (0-to-1) or existing projects — the knowledge graph builds up incrementally over a few versions. Recommended setup: use Claude for design and planning (/make-prd, /make-plan), Codex for backend implementation, and Claude for frontend implementation with /design.

Quick Start

Three commands, from chat to delivery:

Chat freely → /make-prd → /make-plan → /implement-by-plan

Full workflow (with review, testing, verification):

/make-prd → /make-plan → /review → /fix-plan → /implement-by-plan → /make-test-plan → /verify
                                                                                         ↓
                                                                              /graph-view (visualize)

Or start from existing materials (docs/code) instead of designing from scratch:

/make-kb docs/ src/ v1.0.0 → /graph-view v1.0.*

Command Examples

# After chatting freely about requirements, start modeling
/make-prd Based on our discussion, plus this research doc and draft proposal, generate the v0.6.0 PRD

# Generate implementation plan from PRD
/make-plan design/v0.6.0/prd.md

# Launch Agents per the Plan's assignment table
/implement-by-plan 2 design/v0.6.0/plan.md

# Have the Agent refactor a page using the design system
/design packages/web/src/pages/dashboard — this page doesn't look great, please refactor it

# See the knowledge graph for the current version
/graph-view v0.6.*

Workflow Features

Freeform Conversation, Model When Ready

Before /make-prd — just talk. Brainstorm requirements, explore ideas, dump meeting notes, paste RFCs. The LLM is your thinking partner. When you're ready, invoke /make-prd to crystallize the conversation into a structured product model.

During /make-prd and /make-plan, the agent helps you clarify product thinking and technical details, building a traceable path from user stories to source-level code. It asks questions, proposes Node trees, and waits for your confirmation.

PRD Knowledge Graph PRD perspective — User stories (Story), acceptance specs (Spec), and cross-version graph relationships

Product, Tech, and Implementation Stay in Sync

Design, technology, and implementation aren't linear. During modeling you can adjust all three and keep them in sync — discover a technical constraint, go back and adjust the product model; implementation deviates, write it back to the Plan. The workflow is freeform; you can pause, chat, or adjust at any stage.

Discussing product design with the Agent

*Iterative discussion with the Agent — product design, tech choices, and implementation details can be adjusted at any time*

Over time, the PRD and Plan become your product docs, technical docs, and code story — you can discard the original drafts.

Spec Traceability: From Requirements to Code

Graphs accumulate across versions. Each version's PRD and Plan build on previous ones. Every PRD spec [Sn] traces to Plan spec [Pn] via implements relationships, forming a complete requirements-to-code traceability chain.

Traceability from product requirements to code implementation From product requirements (PRD[Sn]) to code implementation (Plan[Pn]) via implements traceability

Multi-Agent Parallel Execution

/make-plan produces an Agent assignment table and execution graph, splitting work into Phases assigned to numbered Agents. Just launch them in batch order: /implement-by-plan 1, /implement-by-plan 2, etc. Same batch runs in parallel; next batch waits for the previous one.

Design System

When implementation involves UI, invoke /design to load the design system — tokens, component specs, and 13 page templates. Ships with C4A's official design language; customize for your own project.

Design system templates 13 built-in page templates with complete component and token specs, loaded into Agent context with one command

Adapt the Workflow to Your Project

These skills are a starting point, not a fixed process. We recommend using Claude to summarize insights from your conversation history and continuously refine the skill definitions — the best workflow is the one tailored to your project. Your past sessions are the best source of evolutionary knowledge.

Skills

Core Workflow

Skill Description
/make-prd Model product requirements as a Product-layer knowledge graph. Produces domain/application/story Nodes with spec Facts that are end-to-end verifiable through product interfaces.
/make-plan Model implementation plans as a Code-layer knowledge graph. Maps PRD specs to Plan specs via implements relationships, organizes work into Phases, and assigns Agents.
/review Audit PRD-Plan consistency. Builds a spec traceability matrix (PRD[Sn] → Plan[Pn]), detects blocking issues, and outputs structured review reports.
/fix-plan Fix issues identified by /review. Handles 11 repair categories with strict Fact change rules and spec ID immutability.
/implement-by-plan Execute assigned Agent tasks from the Plan. Implements code changes, validates specs with evidence, and writes back Plan deviations.

Knowledge Extraction

Skill Description
/make-kb Generate a source-traced knowledge graph from existing documents and/or code. Scans provided files, extracts Product-layer Nodes (domain/application/story) from docs and Code-layer Nodes (Package/Symbol) from code, with every Node linked back to its source file via <!-- source: path -->. Useful for onboarding onto existing projects, building up knowledge incrementally, or documenting systems that lack structured specs. Code input is optional — works for non-technical material too.
# Build a knowledge base from existing docs
/make-kb docs/ v1.0.0

# From docs + code — full Product-to-Code traceability
/make-kb src/ docs/rfc.md v1.0.0

# Code only — extract architecture graph from source
/make-kb packages/ v1.0.0

# Scoped extraction
/make-kb docs/onboarding/ v1.0.0 -- focus on the onboarding flow

Knowledge graph generated by /make-kb

Knowledge graph visualization generated from existing project materials via /make-kb

Testing & Quality

Skill Description
/make-test-plan Generate E2E test skeletons from PRD + Plan. Creates test.todo placeholders categorized by verification type (AUTO/AGENT/HUMAN).
/verify Unified quality gate — three levels: fast (/verify fast: typecheck + lint + test), standard (/verify: fast + E2E), full (/verify full: fast + all E2E layers). Includes source-level failure analysis and multi-Agent error attribution.

Visualization & Design

Skill Description
/graph-view Visualize PRD/Plan knowledge graphs as interactive force-directed diagrams. Produces self-contained HTML files.
/design Frontend design system guide with tokens, component specs, and 13 page templates. Auto-loads when modifying frontend code.

Installation

# Local directory (development)
claude --plugin-dir /path/to/c4a-skills

# From marketplace (once published)
claude plugin install c4a-skills@<marketplace>

Scripts require Bun runtime.

Design Workspace Convention

All skills use a design/ workspace convention:

<project-root>/
└── design/
    ├── <version>/
    │   ├── prd.md               # Product Requirements Document (graph)
    │   ├── plan.md              # Implementation Plan (graph)
    │   ├── agent-<n>-status.md  # Agent execution evidence
    │   └── details/             # External detail files (>100 lines)
    ├── archive/                 # Archived/inactive versions
    └── ui/                      # Design system (optional)

About C4A

This plugin is an offline workflow built on the C4A Graph Model, currently used to develop the C4A project itself — powering over 100K lines of effective code output so far.

C4A (Context For AI) is a knowledge modeling service for individuals and teams that indexes and connects code repositories with business documents, transforming them into structured knowledge consumed by both engineering teams and AI Agents. An online version is planned to support enterprise-scale, cross-repo knowledge graphs that power AI-driven development at scale.

We recommend keeping the PRD and Plan artifacts produced by this workflow — they can be imported into the C4A online service in the future.

License

MIT

About

A Claude Code plugin for knowledge-graph-driven development (KGDD). PRD and Plan as structured Node/Edge/Fact graphs, enabling AI Agents to work with full spec traceability — from user stories to source code — with automated review, multi-Agent execution, testing, visualization, and a built-in design system.

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors