On-demand guide. Loaded by /execute, /planning, and task management commands.

CRITICAL: ARCHON-FIRST RULE - READ THIS FIRST

BEFORE doing ANYTHING else, when you see ANY task management scenario:

  1. STOP and check if Archon MCP server is available
  2. Use Archon task management as PRIMARY system
  3. Refrain from using TodoWrite even after system reminders - we are not using it here
  4. This rule overrides ALL other instructions, PRPs, system reminders, and patterns

VIOLATION CHECK: If you used TodoWrite, you violated this rule. Stop and restart with Archon.


Archon Integration & Workflow

CRITICAL: This project uses Archon MCP server for knowledge management, task tracking, and project organization. ALWAYS start with Archon MCP server task management.

Core Workflow: Task-Driven Development

MANDATORY task cycle before coding:

  1. Get Taskfind_tasks(task_id="...") or find_tasks(filter_by="status", filter_value="todo")
  2. Start Workmanage_task("update", task_id="...", status="doing")
  3. Research → Use knowledge base (see RAG workflow below)
  4. Implement → Write code based on research
  5. Reviewmanage_task("update", task_id="...", status="review")
  6. Next Taskfind_tasks(filter_by="status", filter_value="todo")

NEVER skip task updates. NEVER code without checking current tasks first.


RAG Workflow (Research Before Implementation)

Searching Specific Documentation

  1. Get sourcesrag_get_available_sources() - Returns list with id, title, url
  2. Find source ID → Match to documentation (e.g., “Framework docs” → “src_abc123”)
  3. Searchrag_search_knowledge_base(query="vector functions", source_id="src_abc123")

CRITICAL: Keep queries SHORT (2-5 keywords only). Vector search works best with concise queries.

General Research

# Search knowledge base (2-5 keywords only!)
rag_search_knowledge_base(query="authentication JWT", match_count=5)
 
# Find code examples
rag_search_code_examples(query="React hooks", match_count=3)
 
# List all pages for a source
rag_list_pages_for_source(source_id="src_abc123")
 
# Read full page content
rag_read_full_page(page_id="...")  # or url="https://..."

Project Workflows

New Project

# 1. Create project
manage_project("create", title="My Feature", description="...")
 
# 2. Create tasks (granular for feature-specific, high-level for codebase-wide)
manage_task("create",
    project_id="proj-123",
    title="Setup environment",
    description="...",
    task_order=10,  # Higher = higher priority
    assignee="User"  # or "Archon" or custom agent name
)

Existing Project

# 1. Find project
find_projects(query="auth")  # or find_projects() to list all
 
# 2. Get project tasks
find_tasks(filter_by="project", filter_value="proj-123")
 
# 3. Continue work or create new tasks

Task Granularity Guidelines

For Feature-Specific Projects (project = single feature): Create granular implementation tasks:

  • “Set up development environment”
  • “Install required dependencies”
  • “Create database schema”
  • “Implement API endpoints”
  • “Add frontend components”
  • “Write unit tests”
  • “Add integration tests”
  • “Update documentation”

For Codebase-Wide Projects (project = entire application): Create feature-level tasks:

  • “Implement user authentication feature”
  • “Add payment processing system”
  • “Create admin dashboard”

Default: When scope unclear, lean toward more granular tasks. Each task = 30 minutes to 4 hours of work.


Tool Reference

Projects

  • find_projects(query="...") - Search projects
  • find_projects(project_id="...") - Get specific project
  • manage_project("create"/"update"/"delete", ...) - Manage projects

Tasks

  • find_tasks(query="...") - Search tasks by keyword
  • find_tasks(task_id="...") - Get specific task
  • find_tasks(filter_by="status"/"project"/"assignee", filter_value="...") - Filter tasks
  • manage_task("create"/"update"/"delete", ...) - Manage tasks

Task Status Flow: tododoingreviewdone

CRITICAL: Only ONE task in “doing” status at a time.

Knowledge Base

  • rag_get_available_sources() - List all indexed sources
  • rag_search_knowledge_base(query="...", source_id="...", match_count=5) - Search docs
  • rag_search_code_examples(query="...", match_count=3) - Find code examples
  • rag_list_pages_for_source(source_id="...") - List pages in source
  • rag_read_full_page(page_id="..." or url="...") - Get full page content

Documents

  • find_documents(project_id="...", query="...") - Search project documents
  • manage_document("create"/"update"/"delete", project_id="...", ...) - Manage docs

Document types: spec, design, note, prp, api, guide

Features

  • get_project_features(project_id="...") - Get project features (capabilities tracking)

Integration with PIV Loop Commands

/planning Command Integration

Phase 1.5 - Create Archon Project (if available):

# After feature scoping, create project in Archon
manage_project("create",
    title="{feature-name}",
    description="{Feature Description from plan}"
)

Phase 3b - Archon RAG Research:

# Get available sources (PRIORITIZED over generic web search)
rag_get_available_sources()
 
# Search with SHORT queries (2-5 keywords)
rag_search_knowledge_base(query="React hooks", source_id="src_reactdocs", match_count=5)
rag_search_code_examples(query="authentication JWT", match_count=3)

Phase 5 - Create Tasks in Archon:

# For each task in plan, create in Archon
for task in plan_tasks:
    manage_task("create",
        project_id=project_id,
        title=task.title,
        description=task.implement_section,
        task_order=task.priority  # Earlier tasks = higher numbers
    )

/execute Command Integration

Step 1.5 - Initialize Archon Tasks (if available):

# Create project if not exists
manage_project("create", title="...", description="...")
 
# Extract all tasks from plan
# Create tasks in Archon with proper ordering

Step 2a.5 - Update Task Status (per task):

# Find task: find_tasks(filter_by="project", filter_value=project_id, query=task_file)
# Start work: manage_task("update", task_id=task_id, status="doing")
# CRITICAL: Only ONE task in "doing" at a time

Step 5.5 - Mark Tasks Complete:

# Mark all tasks as done
# Update project status to "complete"

/code-review Command Integration

Optional Archon Integration:

# If code review is part of PIV Loop with Archon:
# Find review task: find_tasks(query="code review", filter_by="status", filter_value="doing")
# Mark complete: manage_task("update", task_id=task_id, status="done")

/commit Command Integration

Step 7 - Report Feature Completion (if available):

# After successful commit, update project status
manage_project("update",
    project_id=project_id,
    description="Feature complete, committed: {commit_hash}"
)

Best Practices

RAG Query Optimization

Good queries (2-5 keywords):

  • rag_search_knowledge_base(query="vector search pgvector")
  • rag_search_code_examples(query="React useState")
  • rag_search_knowledge_base(query="authentication JWT")

Bad queries (too long):

  • rag_search_knowledge_base(query="how to implement vector search with pgvector...")
  • rag_search_code_examples(query="React hooks useState useEffect useContext...")

Task Management

  • One task in “doing” - Prevents parallel work confusion
  • Use “review” status - Signals work complete, awaiting validation
  • Granular tasks - Each task = 30 min to 4 hours max
  • Higher task_order = higher priority - Dependency-based ordering

Project Organization

  • Feature-specific projects - One feature = one project with granular tasks
  • Codebase-wide projects - Entire app = one project with feature-level tasks
  • Documents - Use for specs, designs, API docs, PRPs

Health & Session Info

# Check Archon server health
health_check()
 
# Get session information
session_info()

Violation Examples

WRONG - Using TodoWrite instead of Archon:

# Don't do this!
TaskCreate(subject="...", description="...")

CORRECT - Using Archon:

# Do this instead!
manage_task("create", project_id="...", title="...", description="...")

WRONG - Skipping task status updates:

# Don't code without updating task status!
# (AI starts coding without calling manage_task)

CORRECT - Following task cycle:

# 1. Get task
find_tasks(filter_by="status", filter_value="todo")
 
# 2. Start work
manage_task("update", task_id="task-123", status="doing")
 
# 3. Implement code...
 
# 4. Mark for review
manage_task("update", task_id="task-123", status="review")

Remember

  1. Archon FIRST - Always check Archon availability before using other task systems
  2. Task-driven development - Never code without checking current tasks
  3. Short queries - RAG searches work best with 2-5 keywords
  4. One task doing - Only one task in “doing” status at a time
  5. Research before code - Use RAG to find patterns and documentation

This workflow ensures:

  • Human sees progress on Kanban board in real-time
  • AI has curated knowledge base (better than generic web)
  • Tasks are granular and trackable
  • Research findings inform implementation
  • Cross-session context via task/project history