Skip to content

Commit c2dc7ef

Browse files
committed
feat: add project guidance support for AI commands
- Add .scud/guidance/ folder for project-specific AI context - All .md files in guidance folder automatically loaded for parse/expand - Add --no-guidance flag to skip loading guidance - Fix legacy README references (serve→view, grok-3-mini→grok-code-fast-1) - Fix outdated command references (claim/release removed, whois→who-is) - Update documentation with guidance feature Closes: guidance context feature request
1 parent 1fc3d77 commit c2dc7ef

File tree

11 files changed

+994
-29
lines changed

11 files changed

+994
-29
lines changed

README.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ scud set-status 1 in-progress
4545
scud set-status 1 done
4646

4747
# Visualize in browser
48-
scud serve
48+
scud view
4949
```
5050

5151
**Quick reference:** [docs/reference/QUICK_REFERENCE.md](docs/reference/QUICK_REFERENCE.md)
@@ -101,7 +101,7 @@ Use orchestrator patterns to spawn multiple Claude Code agents in parallel, each
101101
- **Smart scheduling** - `scud next` finds ready tasks
102102

103103
### Web Dashboard
104-
- **Visual task board** - `scud serve` opens browser dashboard
104+
- **Visual task board** - `scud view` opens browser dashboard
105105
- **Mermaid diagrams** - dependency graph visualization
106106
- **Real-time stats** - progress tracking
107107

@@ -149,25 +149,29 @@ scud waves [--tag <tag>] # Show parallel execution waves
149149

150150
### Visualization
151151
```bash
152-
scud serve # Start web dashboard (port 3000)
152+
scud view # Open task viewer in browser
153153
scud mermaid [--tag <tag>] # Generate Mermaid diagram
154154
```
155155

156156
### AI Commands (Requires XAI_API_KEY)
157157
```bash
158158
scud parse <file> --tag <tag> # Parse PRD/doc into tasks
159+
scud parse <file> --tag <tag> --no-guidance # Parse without project guidance
159160
scud analyze-complexity # Analyze task complexity
160161
scud expand --all # Break down complex tasks
162+
scud expand --all --no-guidance # Expand without project guidance
161163
```
162164

163-
Default model: `grok-3-mini`. Configure with `scud config --provider <provider> --model <model>`.
165+
Default model: `grok-code-fast-1`. Configure with `scud config set-provider <provider> --model <model>`.
166+
167+
Project guidance files in `.scud/guidance/*.md` are automatically included in AI prompts.
164168

165169
### Orchestrator Commands
166170
```bash
167-
scud claim <id> --name <name> # Claim task (lock)
168-
scud release <id> # Release task lock
169-
scud whois [--tag <tag>] # See who's working on what
170-
scud doctor [--tag <tag>] # Check for stale locks
171+
scud assign <id> <name> # Assign task to a developer
172+
scud who-is [--tag <tag>] # See who's working on what
173+
scud next-batch [--limit 5] # Get multiple ready tasks
174+
scud doctor [--tag <tag>] # Diagnose stuck workflow states
171175
```
172176

173177
### Utilities
@@ -207,8 +211,8 @@ scud stats --tag auth-system
207211
# Shows progress: 8/10 complete
208212

209213
# 6. Visualize
210-
scud serve
211-
# Opens web dashboard with task graph
214+
scud view
215+
# Opens task viewer in browser
212216
```
213217

214218
See [docs/orchestrator.md](docs/orchestrator.md) for parallel execution patterns.
@@ -262,9 +266,31 @@ Alternative providers: Anthropic (`ANTHROPIC_API_KEY`), OpenAI (`OPENAI_API_KEY`
262266
├── config.toml # Provider/model settings
263267
├── active-tag # Currently active tag
264268
├── current-task # Active task ID (for commits)
269+
├── guidance/ # Project guidance for AI prompts
270+
│ └── *.md # Markdown files auto-loaded
265271
└── logs/ # Task log entries
266272
```
267273

274+
### Project Guidance
275+
276+
You can provide project-specific context that will be automatically included in AI prompts. Create markdown files in `.scud/guidance/`:
277+
278+
```bash
279+
# Example: Add coding standards
280+
echo "# Coding Standards
281+
- Use TypeScript strict mode
282+
- All functions must have JSDoc comments
283+
- Maximum function length: 50 lines" > .scud/guidance/coding-standards.md
284+
285+
# Example: Add architecture notes
286+
echo "# Architecture
287+
- Frontend: React with hooks
288+
- Backend: Express.js
289+
- Database: PostgreSQL" > .scud/guidance/architecture.md
290+
```
291+
292+
All `.md` files in this folder are automatically loaded when running `scud parse` or `scud expand`. Use `--no-guidance` to skip loading guidance.
293+
268294
---
269295

270296
## Development

docs/reference/QUICK_REFERENCE.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ scud stats [--tag <tag>] # Show statistics
2222

2323
### Visualization
2424
```bash
25-
scud serve # Start web dashboard (port 3000)
26-
scud serve --port 8080 # Custom port
25+
scud view # Open task viewer in browser
2726
scud mermaid # Generate Mermaid diagram
2827
scud mermaid --all-tags # All tags in one diagram
2928
scud waves [--tag <tag>] # Show parallel execution waves
@@ -32,22 +31,25 @@ scud waves [--tag <tag>] # Show parallel execution waves
3231
### AI Commands (require XAI_API_KEY)
3332
```bash
3433
scud parse <file> --tag <tag> # Parse PRD into tasks
34+
scud parse <file> --tag <tag> --no-guidance # Skip guidance
3535
scud analyze-complexity # Score all tasks
3636
scud analyze-complexity --task <id> # Score specific task
3737
scud expand <id> # Split complex task
3838
scud expand --all # Split all tasks >13
39+
scud expand --all --no-guidance # Skip guidance
3940
```
4041

41-
Default model: `grok-3-mini`. Configure with `scud config`.
42+
Default model: `grok-code-fast-1`. Configure with `scud config set-provider <provider> --model <model>`.
43+
44+
Project guidance in `.scud/guidance/*.md` is automatically included in prompts.
4245

4346
### Orchestrator Commands
4447
```bash
45-
scud claim <id> --name <name> # Claim task (lock)
46-
scud release <id> # Release task lock
47-
scud whois [--tag <tag>] # See who's working on what
48+
scud assign <id> <name> # Assign task to a developer
49+
scud who-is [--tag <tag>] # See who's working on what
50+
scud next-batch [--limit 5] # Get multiple ready tasks
4851
scud doctor [--tag <tag>] # Diagnose stuck states
4952
scud doctor --fix # Auto-fix stale locks
50-
scud next-batch [--count 5] # Get multiple ready tasks
5153
```
5254

5355
### Utilities
@@ -115,7 +117,7 @@ scud set-status <id> done # Complete
115117

116118
# 6. Track progress
117119
scud stats
118-
scud serve # Web dashboard
120+
scud view # Task viewer
119121
```
120122

121123
---
@@ -128,11 +130,28 @@ scud serve # Web dashboard
128130
├── config.toml # Provider/model settings
129131
├── active-tag # Currently active tag
130132
├── current-task # Active task ID
133+
├── guidance/ # Project guidance for AI
134+
│ └── *.md # Auto-loaded markdown files
131135
└── logs/ # Task log entries
132136
```
133137

134138
---
135139

140+
## Project Guidance
141+
142+
Provide project context for AI commands by adding `.md` files to `.scud/guidance/`:
143+
144+
```bash
145+
.scud/guidance/
146+
├── coding-standards.md # Your coding conventions
147+
├── architecture.md # System architecture notes
148+
└── tech-stack.md # Technology decisions
149+
```
150+
151+
Files are automatically loaded for `parse` and `expand`. Use `--no-guidance` to skip.
152+
153+
---
154+
136155
## SCG Format
137156

138157
Tasks are stored in SCG (SCUD Graph) format. See [SCG_FORMAT_SPEC.md](SCG_FORMAT_SPEC.md).
@@ -166,7 +185,7 @@ export XAI_API_KEY=xai-...
166185
# export OPENROUTER_API_KEY=sk-or-...
167186

168187
# Configure provider/model:
169-
scud config --provider xai --model grok-3-mini
188+
scud config set-provider xai --model grok-code-fast-1
170189
```
171190

172191
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scud-task",
3-
"version": "1.26.0",
3+
"version": "1.29.0",
44
"description": "SCUD Task Manager - Fast, AI-powered task management for building software",
55
"main": "src/validators/scud-validator.js",
66
"bin": {

scud-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "scud-cli"
3-
version = "1.28.1"
3+
version = "1.29.0"
44
edition = "2021"
55
authors = ["SCUD Team"]
66
description = "Fast, simple task master for AI-driven development"

scud-cli/src/commands/ai/expand.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub async fn run(
3838
task_id: Option<&str>,
3939
all_tags: bool,
4040
tag: Option<&str>,
41+
no_guidance: bool,
4142
) -> Result<()> {
4243
let storage = Storage::new(project_root.clone());
4344
let mut all_tasks = storage.load_tasks()?;
@@ -49,6 +50,23 @@ pub async fn run(
4950
LLMClient::new()?
5051
});
5152

53+
// Load guidance unless disabled
54+
let guidance = if no_guidance {
55+
None
56+
} else {
57+
match storage.load_guidance() {
58+
Ok(g) if !g.is_empty() => {
59+
println!("{}", "Loading project guidance...".blue());
60+
Some(g)
61+
}
62+
Ok(_) => None,
63+
Err(e) => {
64+
eprintln!("{} Failed to load guidance: {}", "Warning:".yellow(), e);
65+
None
66+
}
67+
}
68+
};
69+
5270
// Determine which tags to process
5371
let tags_to_process: Vec<String> = if all_tags {
5472
// --all flag: expand across ALL tags
@@ -172,6 +190,9 @@ pub async fn run(
172190
.progress_chars("█▓░"),
173191
);
174192

193+
// Clone guidance for async blocks
194+
let guidance_arc = Arc::new(guidance);
195+
175196
// Process tasks in parallel with bounded concurrency
176197
let results: Vec<Result<TaskExpansionResult, (String, String, anyhow::Error)>> =
177198
stream::iter(tasks_to_expand)
@@ -180,6 +201,7 @@ pub async fn run(
180201
let client = Arc::clone(&client);
181202
let mp = multi_progress.clone();
182203
let overall = overall_progress.clone();
204+
let guidance_clone = Arc::clone(&guidance_arc);
183205

184206
async move {
185207
let spinner = mp.add(ProgressBar::new_spinner());
@@ -199,6 +221,7 @@ pub async fn run(
199221
complexity,
200222
details.as_deref(),
201223
recommended_subtasks,
224+
guidance_clone.as_deref(),
202225
);
203226

204227
// Retry logic

scud-cli/src/commands/ai/parse_prd.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub async fn run(
2424
tag: &str,
2525
num_tasks: u32,
2626
append: bool,
27+
no_guidance: bool,
2728
) -> Result<()> {
2829
let storage = Storage::new(project_root.clone());
2930

@@ -35,6 +36,23 @@ pub async fn run(
3536
println!("{} {}", "Reading PRD from:".blue(), file_path.display());
3637
let prd_content = storage.read_file(file_path)?;
3738

39+
// Load guidance unless disabled
40+
let guidance = if no_guidance {
41+
None
42+
} else {
43+
match storage.load_guidance() {
44+
Ok(g) if !g.is_empty() => {
45+
println!("{}", "Loading project guidance...".blue());
46+
Some(g)
47+
}
48+
Ok(_) => None,
49+
Err(e) => {
50+
eprintln!("{} Failed to load guidance: {}", "Warning:".yellow(), e);
51+
None
52+
}
53+
}
54+
};
55+
3856
// Create LLM client with proper project root
3957
let client = match project_root {
4058
Some(root) => LLMClient::new_with_project_root(root)?,
@@ -52,7 +70,7 @@ pub async fn run(
5270
spinner.enable_steady_tick(std::time::Duration::from_millis(100));
5371

5472
// Call LLM to parse the PRD
55-
let prompt = Prompts::parse_prd(&prd_content, num_tasks);
73+
let prompt = Prompts::parse_prd(&prd_content, num_tasks, guidance.as_deref());
5674
let parsed_tasks: Vec<ParsedTask> = client.complete_json(&prompt).await?;
5775

5876
spinner.finish_with_message(format!(

scud-cli/src/llm/prompts.rs

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
pub struct Prompts;
22

33
impl Prompts {
4-
pub fn parse_prd(phase_content: &str, num_tasks: u32) -> String {
4+
pub fn parse_prd(phase_content: &str, num_tasks: u32, guidance: Option<&str>) -> String {
5+
let guidance_section = guidance
6+
.filter(|g| !g.is_empty())
7+
.map(|g| {
8+
format!(
9+
r#"
10+
## Project Guidance
11+
12+
The following project-specific guidance should inform your task breakdown:
13+
14+
{}
15+
16+
"#,
17+
g
18+
)
19+
})
20+
.unwrap_or_default();
21+
522
format!(
623
r#"You are a Scrum Master parsing a phase into actionable development tasks.
7-
24+
{}
825
Phase Content:
926
{}
1027
@@ -36,7 +53,7 @@ Guidelines:
3653
- Each task should have clear success criteria
3754
3855
Return ONLY the JSON array, no additional explanation."#,
39-
phase_content, num_tasks, num_tasks
56+
guidance_section, phase_content, num_tasks, num_tasks
4057
)
4158
}
4259

@@ -93,14 +110,32 @@ Return ONLY the JSON object, no additional explanation."#,
93110
complexity: u32,
94111
existing_details: Option<&str>,
95112
recommended_subtasks: usize,
113+
guidance: Option<&str>,
96114
) -> String {
97115
let context = existing_details
98116
.map(|d| format!("\nExisting Technical Details:\n{}\n", d))
99117
.unwrap_or_default();
100118

119+
let guidance_section = guidance
120+
.filter(|g| !g.is_empty())
121+
.map(|g| {
122+
format!(
123+
r#"
124+
## Project Guidance
125+
126+
The following project-specific guidance should inform your subtask breakdown:
127+
128+
{}
129+
130+
"#,
131+
g
132+
)
133+
})
134+
.unwrap_or_default();
135+
101136
format!(
102137
r#"You are breaking down a development task into smaller, manageable subtasks.
103-
138+
{}
104139
Original Task (Complexity {}): {}
105140
Description: {}{}
106141
@@ -135,6 +170,7 @@ Guidelines:
135170
- DO NOT include "complexity" field - subtasks are all assumed to be small and manageable
136171
137172
Return ONLY the JSON array, no additional explanation."#,
173+
guidance_section,
138174
complexity,
139175
task_title,
140176
task_description,

0 commit comments

Comments
 (0)