Arckit agent design

From tractorjuice/arckit-codex · View interactive version

Arckit agent design is an AI agent skill from the GitHub repository tractorjuice/arckit-codex. Design AI agent architecture — patterns, tool contracts, memory, orchestration, guardrails

How to use this skill

Skill file

You are helping an enterprise architect design an AI agent architecture specification following a structured, traceable framework.

User Input

$ARGUMENTS

Instructions

Note: Before generating, scan projects/ for existing project directories. For each project, list all ARC-*.md artifacts, check external/ for reference documents, and check 000-global/ for cross-project policies. If no external docs exist but they would improve output, ask the user.

1. Read existing artifacts from the project context

MANDATORY (warn if missing):

RECOMMENDED (read if available, note if missing):

OPTIONAL (read if available, skip silently if missing):

2. Identify the target project

1. Use Glob to list projects/*/ directories and find the highest NNN-* number (or start at 001 if none exist)

2. Calculate the next number (zero-padded to 3 digits, e.g., 002)

3. Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)

4. Use the Write tool to create projects/{NNN}-{slug}/README.md with the project name, ID, and date — the Write tool will create all parent directories automatically

5. Also create projects/{NNN}-{slug}/external/README.md with a note to place external reference documents here

6. Set PROJECT_ID = the 3-digit number, PROJECT_PATH = the new directory path

3. Interactive Configuration

Before generating the agent design, ask the user for key parameters. Skip any question where the user has already provided a clear answer in their arguments.

Gathering rules — the one-message interview in .arckit/references/interview-pattern.md:

Question 1 — header: Pattern, multiSelect: false

"What agent architecture pattern best describes this agent?"

Question 2 — header: Scope, multiSelect: false

"What is the primary scope of this agent?"

4. Read the template

Read the template (with user override support):

Tip: Users can customize templates with $arckit-customize agent-design

5. Gather agent design information

Agent identity and purpose:

Architecture decisions (from Questions or context):

Tool inventory (minimum 3 tools):

Extract from REQ artifacts or define new:

Memory design:

Guardrail requirements (minimum 2 guardrails):

Testing approach:

6. Auto-Populate from Existing Artifacts

CRITICAL: To create a high-quality, integrated agent design, extract data from existing ArcKit artifacts:

6.1 Extract Requirements → Tool Contracts

If projects/{project_id}/ARC-*-REQ-*.md exists:

Read the file and extract:

6.2 Extract Risks → Guardrail Configuration

If projects/{project_id}/ARC-*-RISK-*.md exists:

Read the risk register and extract:

6.3 Extract Stakeholders → Agent Persona

If projects/{project_id}/ARC-*-STKE-*.md exists:

Read stakeholder analysis and extract:

7. Detect Version

Before generating the document ID, check if a previous version exists:

  1. Look for existing ARC-{PROJECT_ID}-AAGR-v*.md files in the project directory
  2. If no existing file: Use VERSION="1.0"
  3. If existing file found:
  1. Use the determined version for document ID, filename, Document Control, and Revision History
  2. For v1.1+/v2.0+: Add a Revision History entry describing what changed from the previous version

8. Construct Document Control Metadata

Populate document control fields:

9. Generate Agent Architecture Specification

CRITICAL INSTRUCTIONS FOR QUALITY:

  1. This is a LARGE document (architecture diagram + tool matrix + orchestration design, 600-1200+ lines). You MUST use the Write tool to create the file. DO NOT output the full document to the user (you will exceed token limits).
  1. Follow the template structure with all 7 sections:

Section 1: Agent Architecture Overview

Section 2: Tool Contracts (minimum 3 tools)

Section 3: Memory Architecture

Section 4: Orchestration Design

Section 5: Guardrail Configuration (minimum 2 guardrails)

Section 6: Testing Strategy

Section 7: Traceability

  1. Auto-populate from artifacts (from Step 6):
  1. Mermaid diagram requirements:

10. Quality Checks

Before writing the file, read .arckit/references/quality-checklist.md and verify all Common Checks plus the AAGR per-type checks pass. Fix any failures before proceeding.

AAGR-specific quality checks:

11. Use Write tool to create the agent design file

CRITICAL - Auto-Populate Document Control Fields:

Before completing the document, populate ALL document control fields in the header following the same pattern as other ArcKit commands.

Step 0: Detect Version

ADRs and agent designs follow the same version detection logic:

Creating a new document (default): Use VERSION="1.0"

Updating an existing document (user explicitly references an existing document):

  1. Look for existing ARC-{PROJECT_ID}-AAGR-v*.md files in projects/{project-dir}/
  2. If no existing file: Use VERSION="1.0"
  3. If existing file found:
  1. Use the determined version for document ID, filename, Document Control, and Revision History

Step 1: Populate Revision History

| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-agent-design` command | [PENDING] | [PENDING] |

Step 2: Populate Generation Metadata Footer

The footer should be populated with:

**Generated by**: ArcKit `$arckit-agent-design` command
**Generated on**: {DATE} {TIME} GMT
**ArcKit Version**: {ARCKIT_VERSION}
**Project**: {PROJECT_NAME} (Project {PROJECT_ID})
**AI Model**: [Use actual model name]
**Generation Context**: [Brief note about source documents used]

12. Show summary to user (NOT full document)

## Agent Architecture Specification Created

**Agent**: {agent_name}
**Document**: projects/{PROJECT_ID}-{project-name}/ARC-{PROJECT_ID}-AAGR-v{VERSION}.md
**Document ID**: ARC-{PROJECT_ID}-AAGR-v{VERSION}

### Architecture Pattern

**Pattern**: {Single Agent / Chain / Multi-Agent / Hierarchical}
**Justification**: {One-sentence rationale}

### Components

- **LLM Core**: {model} — {primary model}
- **Tool Layer**: {N} tools — {tool names}
- **Memory**: Session + Durable + Vector
- **Guardrails**: {N} guardrails — {guardrail names}

### Tool Contracts

| Tool ID | Name | Type |
|---------|------|------|
| T-001 | {name} | {type} |
| T-002 | {name} | {type} |
| T-003 | {name} | {type} |

### Memory Architecture

| Layer | Storage | Retention |
|-------|---------|-----------|
| Session | In-memory | Session only |
| Durable | {DB} | Indefinite |
| Vector | {Vector DB} | Configurable |

### Orchestration

- **Framework**: {LangGraph/CrewAI/etc}
- **Nodes**: {N} nodes in pipeline
- **Error handling**: {Strategy}

### Guardrails

| Guardrail | Type | Action |
|-----------|------|--------|
| {name} | {type} | {action} |
| {name} | {type} | {action} |

### Testing Strategy

| Test Type | Coverage | Tool |
|-----------|----------|------|
| Unit | Tool contracts | pytest |
| Integration | Agent flow | {framework} |
| Security | Prompt injection | {tool} |

### Traceability

- **AAGI**: {N} references
- **REQ**: {N} requirements traced
- **RISK**: {N} risks addressed

### Next Steps

- [ ] Review and validate architecture with stakeholders
- [ ] Create detailed designs for each component
- [ ] Set up tool contracts and MCP servers
- [ ] Implement guardrails and safety layer
- [ ] Develop testing framework
- [ ] Run `$arckit-agent-governance` for oversight, approvals and audit
- [ ] Run `$arckit-agent-security` for security review (it reads the governance framework)
- [ ] Run `$arckit-agent-integration` for multi-agent coordination (it reads the governance and security artefacts)

### Files Created

📄 `projects/{PROJECT_ID}-{project-name}/ARC-{PROJECT_ID}-AAGR-v{VERSION}.md` ({line_count} lines)

Important Notes

Suggested Next Steps

After completing this command, consider running:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.