Generate project-specific custom instructions from project structure
Generates project-specific custom instructions from project structure and configuration files.
/plugin marketplace add krzemienski/shannon-framework/plugin install shannon@shannon-frameworkAnalyzes current project structure and generates custom instructions file (.shannon/custom_instructions.md) containing project-specific conventions, CLI defaults, build commands, and testing patterns. These instructions are automatically loaded at every session start to ensure consistent behavior across sessions.
Analyze project files to determine type:
Gather project-specific data:
Create .shannon/custom_instructions.md with:
# Custom Instructions for {project_name}
## Project Identity
- Name, type, tech stack, entry point
## Build Commands
- Build, test, lint, format, dev server commands
## CLI Argument Defaults (if CLI tool)
- Default arguments to ALWAYS use
- Required flags
- Common usage examples
## Testing Conventions
- Test framework, directory, pattern
- NO MOCKS enforcement
## Code Conventions
- Style guide, linter, formatter
- Pre-commit hooks
## Project-Specific Rules
- Detected from .editorconfig, CONTRIBUTING.md, etc.
## Common Pitfalls
- From git history (reverted commits)
Write file to .shannon/custom_instructions.md and display summary:
✅ Custom Instructions Generated
**Location**: .shannon/custom_instructions.md
**Project Type**: {type}
**Commands Detected**: {count}
**Key Instructions**:
- Build: {build_command}
- Test: {test_command}
{if CLI}
- CLI Defaults: {default_args}
{end if}
**Next Steps**:
1. Review generated instructions
2. Edit to add project-specific rules
3. Instructions will auto-load at session start
**Manual Reload**: /shannon:prime will reload instructions
Regenerate even if .shannon/custom_instructions.md already exists:
/shannon:generate_instructions --force
Use when:
Write to custom location instead of default:
/shannon:generate_instructions --output docs/custom_instructions.md
Default: .shannon/custom_instructions.md
cd /path/to/my-project
/shannon:generate_instructions
# Result: Creates .shannon/custom_instructions.md
# Auto-loaded at next /shannon:prime
/shannon:generate_instructions --force
# Result: Overwrites existing file with fresh analysis
/shannon:generate_instructions
# Review: cat .shannon/custom_instructions.md
# Edit if needed
# Then: /shannon:prime to load
Custom instructions are automatically loaded:
/shannon:prime/shannon:restoreNo manual invocation needed once generated.
Shannon detects when instructions are stale:
When stale, Shannon auto-regenerates during /shannon:prime.
## CLI Argument Defaults
**Default Arguments**: `--project-dir . --verbose`
**IMPORTANT**: ALWAYS use these arguments:
```bash
myapp --project-dir . --verbose <command>
### React Web App
```markdown
## Code Conventions
**Tailwind for all styling**: No inline styles, no CSS files
**Functional components only**: No class components
**TypeScript strict mode**: All files must pass strict checking
❌ Could not detect project type
No package.json, pyproject.toml, Cargo.toml, or other project files found.
**Solutions**:
1. Ensure you're in project root
2. Initialize project first (npm init, cargo init, etc.)
3. Create project files manually
⚠️ Project type unknown
Generated basic instructions. Please review and customize:
- .shannon/custom_instructions.md
Add project-specific rules manually.
Before /shannon:generate_instructions:
After /shannon:generate_instructions:
/shannon:prime - Load generated instructions.shannon/custom_instructions.md manually if neededAutomatic invocation:
/shannon:prime (if no instructions file exists)Version: 5.0.0 (NEW in V5) Status: Specification (implementation in hooks/load_custom_instructions.py)