Skip to content

Commit 7209c0f

Browse files
committed
fix(docs): resolve 8 technical accuracy issues across examples and README
Fix OPA/Cedar mixing, ARN regex, authority hierarchy, sizing contradiction, broken anchor links, DELIVERY_RULES references, git worktree args, nested asyncio.run(), and Mermaid diagram contradictions.
1 parent ebeddd9 commit 7209c0f

15 files changed

Lines changed: 151 additions & 117 deletions

File tree

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,22 @@ graph TD
107107
108108
subgraph "Phase 2: Development (Weeks 3-4)"
109109
D --> G[Spec-Driven Development]
110-
D --> H[Planned Implementation]
111-
G --> I[Progressive Enhancement]
112-
H --> I
110+
H[Planned Implementation]
111+
I[Progressive Enhancement]
113112
I --> J[Choice Generation]
114113
Q[Event Automation]
115114
R[Custom Commands]
116115
S[Progressive Disclosure]
117116
U[Image Spec]
118-
G --> K[Atomic Decomposition]
117+
I --> K[Atomic Decomposition]
119118
K --> L[Parallel Agents]
120119
end
121120
122121
subgraph "Phase 3: Operations (Weeks 5-6)"
123122
C --> M[Policy Generation]
124123
M --> N[Security Orchestration]
125124
N --> T[Centralized Rules]
126-
L --> O[Baseline Management]
125+
F --> O[Baseline Management]
127126
D --> P[Automated Traceability]
128127
end
129128
@@ -446,7 +445,7 @@ Each developer maintains their own prompts and preferences, leading to inconsist
446445
**Maturity**: Beginner
447446
**Description**: Run AI tools in isolated environments without access to secrets or sensitive data to prevent credential leaks and maintain security compliance.
448447

449-
**Related Patterns**: [Security & Compliance Patterns](#security-compliance-patterns), [Codified Rules](#codified-rules), [Event Automation](#event-automation)
448+
**Related Patterns**: [Security & Compliance Patterns](#security--compliance-patterns), [Codified Rules](#codified-rules), [Event Automation](#event-automation)
450449

451450
**Core Security Implementation**
452451

@@ -693,7 +692,7 @@ graph TD
693692

694693
**Core Principles**
695694

696-
- **Small Batch Sizing**: Each work item sized for <1 hour (AI-assisted development velocity) to enable continuous delivery and rapid feedback
695+
- **Small Batch Sizing**: Each work item sized for 4-8 hours max to enable continuous delivery and rapid feedback
697696
- **AI-Assisted Decomposition**: Use AI to break down requirements into implementable tasks
698697
- **Traceability Integration**: Connect issues to implementation files and CI workflows
699698
- **Dependency Mapping**: Establish clear relationships between work items and epics
@@ -1246,7 +1245,9 @@ for branch in $(git branch -r | grep 'agent/'); do
12461245
done
12471246

12481247
# Cleanup
1249-
git worktree remove ../agent-auth ../agent-api ../agent-tests
1248+
git worktree remove ../agent-auth
1249+
git worktree remove ../agent-api
1250+
git worktree remove ../agent-tests
12501251
```
12511252

12521253
**Shared Memory & Coordination**
@@ -2204,7 +2205,7 @@ graph TD
22042205

22052206
```bash
22062207
# Create comprehensive error context file
2207-
cat > .error-context.md << 'EOF'
2208+
cat > .error-context.md << EOF
22082209
# Error Analysis
22092210
22102211
**Error Output:**
@@ -2427,8 +2428,8 @@ Operations patterns focus on CI/CD, security, compliance, and production managem
24272428
ai "Convert compliance requirements into Cedar policy code:
24282429
SOC 2: Data at rest must be AES-256 encrypted" > encryption.cedar
24292430

2430-
# Test generated policies
2431-
opa test encryption.cedar
2431+
# Validate generated Cedar policies
2432+
cedar validate --schema schema.cedarschema encryption.cedar
24322433
```
24332434

24342435
**Complete Implementation**: See [examples/policy-generation/](examples/policy-generation/) for:
@@ -2611,9 +2612,9 @@ Manual thresholds quickly become stale, causing alert storms or blind spots.
26112612
4. **[Atomic Decomposition](#atomic-decomposition)** - Break down complex features
26122613

26132614
### Phase 3: Operations (Weeks 5-6)
2614-
1. **[Security & Compliance Patterns](#security-compliance-patterns)** - Implement unified security framework
2615+
1. **[Security & Compliance Patterns](#security--compliance-patterns)** - Implement unified security framework
26152616
2. **[Deployment Automation Patterns](#deployment-automation-patterns)** - Establish AI-powered CI/CD
2616-
3. **[Monitoring & Maintenance Patterns](#monitoring-maintenance-patterns)** - Deploy proactive system management
2617+
3. **[Monitoring & Maintenance Patterns](#monitoring--maintenance-patterns)** - Deploy proactive system management
26172618

26182619
**Note**: For teams practicing continuous delivery, implement security ([Security Sandbox](#security-sandbox), AI Security & Compliance) and deployment patterns (Deployment Automation) from week 1 alongside foundation patterns. The phases represent learning dependencies, not deployment sequences.
26192620

docs/claude-code-guide.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -609,29 +609,25 @@ workflows:
609609

610610
**1. Automated Code Review**
611611
```bash
612-
# .claude/hooks/pre-commit
613-
claude review --files "$(git diff --cached --name-only)" \
614-
--checklist ".claude/review-checklist.md" \
615-
--output "review-report.md"
612+
# Use single-prompt mode in a pre-commit hook or CI step
613+
claude -p "Review the staged changes for bugs, security issues, and style \
614+
violations. Check against the guidelines in .claude/review-checklist.md. \
615+
Output a summary of findings." --output-file review-report.md
616616
```
617617

618618
**2. Documentation Generation**
619619
```bash
620-
# Generate comprehensive docs
621-
claude document \
622-
--source "src/**/*.ts" \
623-
--format "markdown" \
624-
--include-examples \
625-
--output "docs/api/"
620+
# Generate docs using single-prompt mode
621+
claude -p "Generate comprehensive API documentation in markdown for all \
622+
exported functions in src/**/*.ts. Include usage examples. \
623+
Write the output to docs/api/."
626624
```
627625

628626
**3. Test Generation**
629627
```bash
630-
# Generate tests for new code
631-
claude generate-tests \
632-
--target "src/services/newFeature.ts" \
633-
--coverage-target 90 \
634-
--include-edge-cases
628+
# Generate tests using single-prompt mode
629+
claude -p "Generate tests for src/services/newFeature.ts targeting 90% \
630+
coverage. Include edge cases for error handling and boundary conditions."
635631
```
636632

637633
### Building Autonomous Agents

examples/codified-rules/CLAUDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Build a simple, reliable subscription reminder system that helps users avoid une
3535
- **VALIDATE** all AI-generated code
3636
- **MAINTAIN** .ai/ configuration directory with standards
3737

38-
### 3. DELIVERY_RULES.md - CI/CD Pipeline & Deployment
38+
### 3. PIPELINE_RULES.md - CI/CD Pipeline & Deployment
3939
- **ENFORCE** branch age < 2 days
4040
- **REQUIRE** build time < 10 minutes
4141
- **VALIDATE** all AI output through security gates
@@ -90,7 +90,7 @@ Per QUALITY_RULES.md requirements:
9090
```
9191

9292
### Pipeline Requirements
93-
Per DELIVERY_RULES.md requirements:
93+
Per PIPELINE_RULES.md requirements:
9494
1. **Version Control**: All configs, specs, and IaC in Git
9595
2. **Testing Pyramid**: 70% unit, 20% integration, 10% E2E
9696
3. **Deployment Safety**: Feature flags for gradual rollout
@@ -130,14 +130,14 @@ Per DELIVERY_RULES.md requirements:
130130
- Follow SOLID principles
131131
- Include traceability comments
132132

133-
4. **VALIDATE LOCALLY** (DELIVERY_RULES.md)
133+
4. **VALIDATE LOCALLY** (PIPELINE_RULES.md)
134134
```bash
135135
pytest tests/ --cov=src --cov-fail-under=90
136136
./check_traceability.sh
137137
pre-commit run --all-files
138138
```
139139

140-
5. **DEPLOY SAFELY** (DELIVERY_RULES.md)
140+
5. **DEPLOY SAFELY** (PIPELINE_RULES.md)
141141
- Complete ORR checklist
142142
- Use feature flags
143143
- Monitor rollout
@@ -221,7 +221,7 @@ subscription-alerts/
221221
├── docs/
222222
│ ├── DEVELOPMENT_RULES.md # Test-first practices
223223
│ ├── QUALITY_RULES.md # Code standards
224-
│ └── DELIVERY_RULES.md # CI/CD requirements
224+
│ └── PIPELINE_RULES.md # CI/CD requirements
225225
└── run_tests.sh # Local = CI
226226
```
227227

@@ -305,7 +305,7 @@ When reviewing or implementing code:
305305
- SOLID principles followed?
306306
- Logging structured?
307307

308-
3. **THIRD**: Check DELIVERY_RULES.md
308+
3. **THIRD**: Check PIPELINE_RULES.md
309309
- Branch < 2 days old?
310310
- Build < 10 minutes?
311311
- ORR complete?
@@ -319,6 +319,6 @@ If ANY check fails, STOP and report the violation.
319319
**The three rules are LAW:**
320320
- DEVELOPMENT_RULES.md = How we write (test-first, traceable)
321321
- QUALITY_RULES.md = What we write (clean, observable)
322-
- DELIVERY_RULES.md = How we ship (safe, automated)
322+
- PIPELINE_RULES.md = How we ship (safe, automated)
323323

324324
**Every code change must comply with ALL THREE rule files. No exceptions.**

examples/codified-rules/PIPELINE_RULES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DELIVERY_RULES - CI/CD Pipeline & Deployment Excellence
1+
# PIPELINE_RULES - CI/CD Pipeline & Deployment Excellence
22

33
**CRITICAL: Review these rules before EVERY change to code, pipeline, or infrastructure. Non-negotiable requirements for continuous delivery.**
44

examples/developer-lifecycle/comprehensive-workflow-example.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,23 +318,26 @@ Generate monitoring dashboard configuration for authentication metrics."
318318

319319
### Claude Code
320320
```bash
321-
# Use Plan Mode for initial planning
322-
claude plan "Implement JWT authentication for SaaS application"
323-
324-
# Use implementation mode for function development
325-
claude implement "Generate JWT service following OpenAPI specification"
326-
327-
# Use review mode for integration testing
328-
claude review "Validate complete authentication flow implementation"
321+
# Start interactive session and enter plan mode
322+
claude
323+
# Then in the session:
324+
# > /plan
325+
# > "Design JWT authentication for SaaS application"
326+
# > /exitplan
327+
# > "Implement the JWT service following the OpenAPI specification"
328+
# > "Review and validate the complete authentication flow"
329+
330+
# Or use single-prompt mode for scripted workflows
331+
claude -p "Generate JWT service following OpenAPI specification"
329332
```
330333

331334
### Cursor
332335
```bash
333-
# Use /plan command for structured planning
334-
/plan JWT authentication implementation with security requirements
336+
# Use Cmd+L chat with @codebase for planning context
337+
# "Plan JWT authentication implementation with security requirements" @codebase
335338

336-
# Use @codebase for implementation with context
337-
/implement JWT service @codebase following test specifications
339+
# Use Cmd+K inline edit to implement with file context
340+
# "Implement JWT service following test specifications" @file:auth.test.ts
338341

339342
# Use /fix for handling implementation issues
340343
/fix authentication endpoint failing test cases

examples/developer-lifecycle/enhanced-implementation-techniques.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -367,32 +367,42 @@ ai "Break registration validation into individual functions:
367367

368368
### Claude Code Enhanced Workflow
369369
```bash
370-
# Use Plan Mode for comprehensive planning
371-
claude plan "Implement comprehensive user authentication with JWT, session migration, and mobile support"
372-
373-
# Use enhanced context in implementation mode
374-
claude implement "JWT authentication service" --context="existing session system, PostgreSQL users table, mobile app requirements"
375-
376-
# Apply Five-Try Rule systematically
377-
claude retry "authentication implementation" --attempt=3 --previous-failures="token validation errors, session migration issues"
378-
379-
# Use review mode for integration validation
380-
claude review "complete authentication flow" --focus="security, performance, integration points"
370+
# Start interactive session with plan mode for comprehensive planning
371+
claude
372+
# Then in the session:
373+
# > /plan
374+
# > "Implement comprehensive user authentication with JWT, session migration,
375+
# and mobile support. Consider existing session system, PostgreSQL users
376+
# table, and mobile app requirements."
377+
# > /exitplan
378+
379+
# Implement with context — reference relevant files directly
380+
# > "Implement JWT authentication service. See src/auth/ for the existing
381+
# session system and db/schema.sql for the users table."
382+
383+
# Apply Five-Try Rule — provide failure context in follow-up prompts
384+
# > "The token validation is failing with [error]. Previous attempts had
385+
# session migration issues. Try a different approach."
386+
387+
# Review the implementation
388+
# > "Review the complete authentication flow for security, performance,
389+
# and integration concerns."
381390
```
382391

383392
### Cursor Enhanced Workflow
384393
```bash
385-
# Use /plan with comprehensive context
386-
/plan JWT authentication implementation @codebase @docs considering existing session system and mobile requirements
394+
# Use Cmd+L chat with comprehensive context references
395+
# "Implement JWT authentication considering existing session system and mobile
396+
# requirements" @codebase @docs
387397

388-
# Enhanced implementation with context
389-
/implement JWT service @existing-auth @session-middleware following test specifications
398+
# Use Cmd+K inline edit with specific file context
399+
# "Implement JWT service following test specifications" @file:auth.test.ts @file:session.ts
390400

391-
# Systematic retry with context
392-
/fix authentication issues @previous-attempts considering alternative approaches
401+
# Use /fix with context for systematic retry
402+
/fix authentication issues @codebase
393403

394-
# Integration validation
395-
/validate complete auth flow @tests @integration ensuring security and performance standards
404+
# Review integration with Cmd+L chat
405+
# "Review complete auth flow for security and performance standards" @codebase
396406
```
397407

398408
## Success Metrics and Validation

examples/parallel-agents/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ def main(task_file: str, task_id: str):
293293
agent = AIAgent(agent_id, task_id)
294294
295295
# Run the task
296-
asyncio.run(agent.execute_task(asyncio.run(agent.load_task(task_file))))
296+
async def run():
297+
task = await agent.load_task(task_file)
298+
await agent.execute_task(task)
299+
asyncio.run(run())
297300
298301
if __name__ == "__main__":
299302
main()

examples/planned-implementation/cursor-example.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
# Cursor Planning Example
22

3-
This example demonstrates how to use Cursor's `/plan` command and planning features to implement a React component library.
3+
This example demonstrates how to use Cursor's Composer and Chat features to plan and implement a React component library.
44

55
## Scenario
66
Building a reusable design system component library for a React application with TypeScript, Storybook, and automated testing.
77

8-
## Step 1: Using Cursor's /plan Command
8+
## Step 1: Using Cursor's Composer for Planning
99

10-
Open Cursor's chat and use the `/plan` command:
10+
Open Cursor's Composer (Cmd+I / Ctrl+I) and describe the project:
1111

1212
```
13-
/plan Create a React component library with the following requirements:
13+
Create a React component library with the following requirements:
1414
- TypeScript support with strict typing
1515
- Storybook for component documentation
1616
- Jest testing with React Testing Library
1717
- CSS-in-JS with styled-components
1818
- Rollup for bundling
1919
- Publishing to npm
2020
- Components: Button, Input, Modal, Card
21+
22+
Start by creating an implementation plan before writing any code.
2123
```
2224

2325
## Step 2: Cursor Generated Plan
@@ -80,7 +82,7 @@ src/
8082

8183
## Step 3: Interactive Plan Refinement
8284

83-
Use Cursor's iterative planning approach:
85+
Use Cursor's chat (Cmd+L / Ctrl+L) to iterate on the plan:
8486

8587
```
8688
This plan looks great! Can you expand the theming section? I need:
@@ -114,7 +116,7 @@ Also, add ESLint and Prettier configuration to Phase 1.
114116

115117
## Step 4: Execute with Cursor
116118

117-
Start implementation with plan reference:
119+
Start implementation using the Composer with plan reference:
118120

119121
```
120122
Let's start with Phase 1. Begin by creating the package.json and TypeScript configuration according to our plan.
@@ -138,18 +140,18 @@ export const Button = styled.button<ButtonProps>`
138140

139141
## Benefits Demonstrated
140142

141-
1. **Modular Planning**: Cursor's `/plan` breaks work into logical phases
143+
1. **Structured Planning**: Composer breaks work into logical phases
142144
2. **Interactive Refinement**: Easy to modify plan based on new requirements
143145
3. **Contextual Implementation**: Code generation follows plan structure
144146
4. **Progress Visibility**: Clear tracking of implementation status
145147
5. **Team Alignment**: Shareable plan format for collaboration
146148

147149
## Cursor-Specific Features Used
148150

149-
- **`/plan` command**: Generates structured implementation roadmap
150-
- **Interactive chat**: Allows plan iteration and refinement
151-
- **Context awareness**: Understands existing project structure
152-
- **Code generation**: Implements following plan specifications
153-
- **Inline comments**: Tracks progress against plan
151+
- **Composer (Cmd+I)**: Multi-file code generation following plan specifications
152+
- **Chat (Cmd+L)**: Plan iteration, refinement, and asking questions with @codebase context
153+
- **@codebase / @file references**: Provides context awareness of existing project structure
154+
- **Inline edits (Cmd+K)**: Targeted code changes within plan specifications
155+
- **`/fix` command**: Addresses failing tests during implementation
154156

155157
This example demonstrates how Cursor's planning features create a structured approach to complex component library development.

0 commit comments

Comments
 (0)