@tanagram/cli 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/tanagram CHANGED
Binary file
@@ -60,28 +60,33 @@ func ExtractPolicies(ctx context.Context, content string) ([]parser.Policy, erro
60
60
 
61
61
  // buildExtractionPrompt creates the prompt for policy extraction
62
62
  func buildExtractionPrompt(content string) string {
63
- return fmt.Sprintf(`You are a code policy extraction system. Extract ONLY coding policies that apply when developers write and edit code.
64
-
65
- Analyze the following instruction file and extract policies that define:
66
- - Code structure and organization rules
67
- - Coding standards and style guidelines
68
- - Language-specific patterns and practices
69
- - File naming and directory conventions
70
- - Error handling requirements
71
- - Security practices in code
72
- - Testing requirements
73
- - Performance optimization rules
74
- - Import/dependency management
75
-
76
- DO NOT extract:
63
+ return fmt.Sprintf(`You are a code policy extraction system. Extract ONLY policies that define anti-patterns or bad practices that can be detected by reading code.
64
+
65
+ IMPORTANT: Extract policies about what the CODE should or shouldn't look like. DO NOT extract policies that require running commands, executing tools, or performing actions.
66
+
67
+ Extract policies that define CODE ANTI-PATTERNS:
68
+ - Code structure and organization anti-patterns (e.g., "Don't use deeply nested functions")
69
+ - Coding standards violations (e.g., "Don't use var, use let/const")
70
+ - Language-specific anti-patterns (e.g., "Don't use 'any' type in TypeScript")
71
+ - Prohibited code patterns (e.g., "Don't hardcode API keys")
72
+ - Security anti-patterns in code (e.g., "Don't use eval()")
73
+ - Error handling anti-patterns (e.g., "Don't swallow exceptions silently")
74
+ - Import/dependency anti-patterns (e.g., "Don't import entire lodash library")
75
+
76
+ DO NOT extract policies that require ACTIONS or COMMANDS:
77
+ - Running tests (e.g., "Run pytest before committing")
78
+ - Running linters or formatters (e.g., "Run black on all Python files")
79
+ - Building or compiling (e.g., "Build the project to verify")
80
+ - Running scripts or commands (e.g., "Execute database migrations")
81
+ - Using specific tools (e.g., "Use ruff format" - this requires running ruff)
77
82
  - Agent behavior instructions (how AI agents should operate)
78
83
  - Workflow or process instructions
79
- - Tool usage instructions
80
84
  - Communication style guidelines
81
85
  - Project management policies
82
- - Non-code related guidelines
83
86
 
84
- For each code policy, provide:
87
+ CRITICAL: If a policy would require the agent to run a command or tool to fix a violation, DO NOT extract it. Only extract policies about code patterns that can be fixed by editing code directly.
88
+
89
+ For each code anti-pattern policy, provide:
85
90
  1. Name: Short descriptive name (2-5 words)
86
91
  2. Message: The full policy text or a clear summary
87
92
  3. OriginalText: The exact text from the file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanagram/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Tanagram - Catch sloppy code before it ships",
5
5
  "main": "index.js",
6
6
  "bin": {