Skip to content

Commit 09c0ca6

Browse files
Added in AGENTS and claude * commands plus plugins
1 parent 1843191 commit 09c0ca6

File tree

3 files changed

+105
-46
lines changed

3 files changed

+105
-46
lines changed

bin/intent_helpers

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -616,34 +616,10 @@ migrate_v2_2_to_v2_2_1() {
616616
echo " Version updated to $target_version"
617617
}
618618

619-
# Migrate v2.2.x to v2.3.0 - Plugin architecture and AGENTS.md support
620-
migrate_v2_2_to_v2_3_0() {
619+
# Generate basic AGENTS.md as fallback
620+
_generate_basic_agents_md() {
621621
local project_root=$1
622-
623-
local target_version="$(get_intent_version 2>/dev/null || echo "2.3.0")"
624-
echo "Upgrading to Intent v$target_version with plugin architecture..."
625-
626-
# 1. Create plugin directory structure
627-
echo " Creating plugin architecture..."
628-
mkdir -p "$project_root/intent/plugins/claude/subagents"
629-
mkdir -p "$project_root/intent/plugins/agents/templates"
630-
631-
# 2. Migrate agents to plugin location
632-
if [ -d "$project_root/agents" ]; then
633-
echo " Migrating agents to plugin location..."
634-
if [ "$(ls -A "$project_root/agents" 2>/dev/null)" ]; then
635-
cp -r "$project_root/agents/"* "$project_root/intent/plugins/claude/subagents/" 2>/dev/null || true
636-
fi
637-
# Keep old agents directory for now, will be cleaned up later
638-
fi
639-
640-
# 3. Create AGENTS.md if it doesn't exist
641-
if [ ! -f "$project_root/AGENTS.md" ] && [ ! -f "$project_root/intent/llm/AGENTS.md" ]; then
642-
echo " Generating AGENTS.md..."
643-
mkdir -p "$project_root/intent/llm"
644-
645-
# Generate basic AGENTS.md
646-
cat > "$project_root/intent/llm/AGENTS.md" << 'EOF'
622+
cat > "$project_root/intent/llm/AGENTS.md" << 'EOF'
647623
# AGENTS.md
648624
649625
## Project Overview
@@ -657,28 +633,76 @@ This is an Intent project. See CLAUDE.md for project-specific guidelines.
657633
## Build and Test Commands
658634
### Testing
659635
```bash
660-
# Run tests if configured
636+
# Check for test scripts in your project
661637
intent doctor
662638
```
663639
664640
## Code Style Guidelines
665-
- Shell scripts: 2-space indentation, POSIX compliance
666-
- Markdown: Standard formatting with verblock headers
667641
- Follow existing patterns in the codebase
642+
- See CLAUDE.md for project-specific guidelines
668643
669644
## Intent-Specific Information
670645
### Steel Thread Process
671646
Work is organized into steel threads (ST####) under intent/st/
672647
673648
### Available Commands
674649
- `intent st list` - List all steel threads
675-
- `intent agents init` - Initialize AGENTS.md
650+
- `intent agents sync` - Update this AGENTS.md
676651
- `intent claude subagents list` - List Claude subagents
677652
EOF
653+
echo " Generated basic AGENTS.md template"
654+
}
655+
656+
# Migrate v2.2.x to v2.3.0 - Plugin architecture and AGENTS.md support
657+
migrate_v2_2_to_v2_3_0() {
658+
local project_root=$1
659+
660+
local target_version="$(get_intent_version 2>/dev/null || echo "2.3.0")"
661+
echo "Upgrading to Intent v$target_version with plugin architecture..."
662+
663+
# 1. Create plugin directory structure
664+
echo " Creating plugin architecture..."
665+
mkdir -p "$project_root/intent/plugins/claude/subagents"
666+
mkdir -p "$project_root/intent/plugins/agents/templates"
667+
668+
# 2. Migrate agents to plugin location
669+
if [ -d "$project_root/agents" ]; then
670+
echo " Migrating agents to plugin location..."
671+
if [ "$(ls -A "$project_root/agents" 2>/dev/null)" ]; then
672+
cp -r "$project_root/agents/"* "$project_root/intent/plugins/claude/subagents/" 2>/dev/null || true
673+
fi
674+
# Keep old agents directory for now, will be cleaned up later
675+
fi
676+
677+
# 3. Create AGENTS.md if it doesn't exist
678+
if [ ! -f "$project_root/AGENTS.md" ] && [ ! -f "$project_root/intent/llm/AGENTS.md" ]; then
679+
echo " Generating AGENTS.md..."
680+
mkdir -p "$project_root/intent/llm"
681+
682+
# Use the smart generator from intent_agents if available
683+
local agents_script="$INTENT_HOME/intent/plugins/agents/bin/intent_agents"
684+
if [ -f "$agents_script" ]; then
685+
# Source the script to get the generator function
686+
PROJECT_ROOT="$project_root" source "$agents_script" >/dev/null 2>&1
687+
688+
# Generate project-specific AGENTS.md
689+
if type intent_agents_generate_content >/dev/null 2>&1; then
690+
intent_agents_generate_content > "$project_root/intent/llm/AGENTS.md"
691+
echo " Generated project-specific AGENTS.md"
692+
else
693+
# Fallback to basic template if function not available
694+
_generate_basic_agents_md "$project_root"
695+
fi
696+
else
697+
# Fallback to basic template if script not found
698+
_generate_basic_agents_md "$project_root"
699+
fi
678700

679701
# Create symlink at project root
680702
ln -sf "intent/llm/AGENTS.md" "$project_root/AGENTS.md"
681703
echo " Created AGENTS.md with symlink at project root"
704+
elif [ -f "$project_root/AGENTS.md" ] || [ -f "$project_root/intent/llm/AGENTS.md" ]; then
705+
echo " AGENTS.md already exists, skipping generation"
682706
fi
683707

684708
# 4. Update .intent/config.json

bin/intent_init

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,50 @@ verblock: "$DATE:v0.1: $AUTHOR - Initial version"
142142
[Implementation details]
143143
EOF
144144

145-
# Create LLM preamble
146-
cat > "intent/llm/llm_preamble.md" << EOF
147-
---
148-
verblock: "$DATE:v0.1: $AUTHOR - Initial version"
149-
---
150-
# LLM Preamble - $PROJECT_NAME
151-
152-
## Project Context
153-
154-
This is the $PROJECT_NAME project, created by $AUTHOR on $DATE.
145+
# Helper function for basic AGENTS.md
146+
_create_basic_agents_md() {
147+
cat > "intent/llm/AGENTS.md" << EOF
148+
# AGENTS.md
149+
150+
## Project Overview
151+
$PROJECT_NAME - Created by $AUTHOR on $DATE
152+
153+
## Development Environment
154+
### Prerequisites
155+
- [Add your project requirements]
156+
157+
## Build and Test Commands
158+
### Testing
159+
\`\`\`bash
160+
# Add your test commands
161+
\`\`\`
162+
163+
## Code Style Guidelines
164+
- Follow existing patterns in the codebase
165+
- See CLAUDE.md for Intent-specific guidelines
166+
167+
## Intent-Specific Information
168+
See CLAUDE.md for Intent project structure and commands.
169+
EOF
170+
}
155171

156-
## Instructions
172+
# Create AGENTS.md using smart generator
173+
echo "Creating AGENTS.md..."
174+
# Try to use the smart generator if Intent is installed
175+
if [ -n "$INTENT_HOME" ] && [ -f "$INTENT_HOME/intent/plugins/agents/bin/intent_agents" ]; then
176+
# Call the generator directly
177+
PROJECT_ROOT="$(pwd)" "$INTENT_HOME/bin/intent" agents generate > "intent/llm/AGENTS.md" 2>/dev/null
178+
if [ ! -s "intent/llm/AGENTS.md" ]; then
179+
# Fallback to basic template if generation failed
180+
_create_basic_agents_md
181+
fi
182+
else
183+
# Fallback to basic template
184+
_create_basic_agents_md
185+
fi
157186

158-
[Add specific instructions for AI assistants working on this project]
159-
EOF
187+
# Create symlink at project root
188+
ln -sf "intent/llm/AGENTS.md" "AGENTS.md"
160189

161190
# Create CLAUDE.md
162191
cat > "CLAUDE.md" << EOF

intent/llm/llm_preamble.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
---
2-
verblock: "27 Jul 2025:v0.2: Matthew Sinclair - Updated for Intent v2.1.0 with agent system"
2+
verblock: "20 Aug 2025:v0.3: DEPRECATED - Replaced by AGENTS.md in Intent v2.3.0"
33
intent_version: 2.1.0
44
---
5-
# LLM Preamble
5+
# LLM Preamble [DEPRECATED]
6+
7+
> **⚠️ DEPRECATION NOTICE**: This file is deprecated as of Intent v2.3.0.
8+
> LLM context is now provided via AGENTS.md which follows the universal
9+
> AGENTS.md specification. See the AGENTS.md file in this project.
10+
>
11+
> This file is kept for backward compatibility but will be removed in a future version.
612
713
This document provides essential context for LLMs working with Intent projects.
814

0 commit comments

Comments
 (0)