feat(protection): implement multi-layered protection for feature_list.json

Introduces a comprehensive strategy to safeguard the feature_list.json file from accidental modifications. Key enhancements include:

1. **Prompt-Level Warnings**: Added explicit warnings in agent prompts to prevent direct modifications.
2. **Dedicated MCP Tool**: Implemented the UpdateFeatureStatus tool for safe feature updates.
3. **File-Level Validation & Auto-Backup**: Added validation checks and automatic backups before modifications to prevent data loss.
4. **Tool Access Control**: Restricted agent access to critical tools, ensuring only the designated MCP tool can modify the feature list.

This update significantly reduces the risk of catastrophic data loss and ensures a robust feature management process.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
Cody Seibert
2025-12-09 19:47:10 -05:00
parent 7cee3bbd9f
commit ac5b562f7a
15 changed files with 855 additions and 370 deletions

View File

@@ -1,142 +0,0 @@
📋 Planning implementation for: Fix the design of this section to use the theme we have elsewhere
⚡ Executing implementation for: Fix the design of this section to use the theme we have elsewhere
Starting code implementation...
🔧 Tool: Glob
Let me look at the project structure more specifically to understand where the settings section is:
🔧 Tool: Bash
I found the settings view. Let me read it along with some other views to understand the theme that should be applied:
🔧 Tool: Read
🔧 Tool: Read
🔧 Tool: Read
Now I can see the issue. Looking at the settings-view.tsx, I can see:
1. The **API Keys Section** and **Appearance Section** use the theme-consistent styling with `border-border`, `bg-card`, and theme-aware text colors like `text-foreground`, `text-muted-foreground`.
2. However, the **Kanban Card Display Section** (lines 556-628) uses hardcoded dark theme colors:
- `border-white/10` instead of `border-border`
- `bg-zinc-900/50` instead of `bg-card`
- `text-white` instead of `text-foreground`
- `text-zinc-400` instead of `text-muted-foreground`
- `text-zinc-300` instead of `text-foreground`
- `text-zinc-500` instead of `text-muted-foreground`
- `bg-white/5` and `bg-zinc-950/50` instead of theme-aware colors
Let me also check the context-view and board-view for more examples of consistent theming patterns:
🔧 Tool: Read
Now I have a complete understanding of the theme system. The issue is clear:
1. The **Kanban Card Display Section** in `settings-view.tsx` (lines 556-628) uses hardcoded dark theme styles like `text-white`, `text-zinc-400`, `bg-zinc-900/50`, `border-white/10`, etc.
2. It should use theme variables like:
- `text-foreground` instead of `text-white`
- `text-muted-foreground` instead of `text-zinc-400`, `text-zinc-500`
- `bg-card` instead of `bg-zinc-900/50`
- `border-border` instead of `border-white/10`
- `bg-secondary` instead of `bg-white/5`
- `bg-input` instead of `bg-zinc-950/50`
- `bg-accent` instead of `bg-white/5`
Let me also check the "Back to Home" button at the end of the file which also has hardcoded styles:
Looking at the code, I need to fix:
1. **Lines 556-628 - Kanban Card Display Section** - Replace hardcoded colors with theme variables
2. **Lines 649 - Back to Home button** - Also uses hardcoded `bg-white/5`, `hover:bg-white/10`, `text-white`, `border-white/10`
Let me make these changes:
🔧 Tool: Edit
Now let me also fix the "Back to Home" button which has hardcoded styles:
🔧 Tool: Edit
Let me verify if there are any other hardcoded theme values in the file that I might have missed:
🔧 Tool: Grep
There are two more instances of `text-zinc-500` that need to be fixed. Let me see the context around them:
🔧 Tool: Read
🔧 Tool: Read
I can see these are description/helper texts. Let me fix these to use the theme-consistent `text-muted-foreground`:
🔧 Tool: Edit
🔧 Tool: Edit
Let me verify there are no more hardcoded theme values:
🔧 Tool: Grep
All the hardcoded theme values have been replaced. Let me now verify the file compiles properly by running a quick syntax check:
🔧 Tool: Bash
Those are just missing configuration errors for standalone TSC run (project path aliases and JSX config), not actual code issues. Let me try the proper Next.js build check:
🔧 Tool: Bash
The build errors are pre-existing issues (missing npm packages and network issues with fonts), not related to my changes. The actual TypeScript/React code in the settings-view.tsx file is syntactically correct.
Let me double-check by looking at the final state of the modified sections:
🔧 Tool: Read
The changes have been applied correctly. Now the Settings View uses the consistent theme classes:
**Changes Made Summary:**
1. **Kanban Card Display Section** (lines 556-628):
- Changed `border-white/10` to `border-border`
- Changed `bg-zinc-900/50` to `bg-card`
- Changed `text-white` to `text-foreground`
- Changed `text-zinc-400` to `text-muted-foreground`
- Changed `text-zinc-300` to `text-foreground`
- Changed `text-zinc-500` to `text-muted-foreground`
- Changed `bg-white/5` to `bg-accent`
- Changed `bg-zinc-950/50` to `bg-input`
2. **Back to Home Button** (line 649):
- Changed `bg-white/5 hover:bg-white/10 text-white border border-white/10` to `bg-secondary hover:bg-accent text-secondary-foreground border border-border`
3. **API Key Help Text** (lines 245 and 339):
- Changed `text-zinc-500` to `text-muted-foreground`
Now let me mark this feature as verified using the UpdateFeatureStatus tool:
🔧 Tool: mcp__automaker-tools__UpdateFeatureStatus
The feature has been implemented successfully. Here's a summary of what was done:
## Feature Complete: Fix Settings Design to Use Theme Variables
### Changes Made to `app/src/components/views/settings-view.tsx`:
1. **Kanban Card Display Section** - Replaced all hardcoded dark theme colors with theme-aware CSS variables:
- Container: `border-white/10 bg-zinc-900/50``border-border bg-card`
- Headers: `text-white``text-foreground`
- Descriptions: `text-zinc-400``text-muted-foreground`
- Labels: `text-zinc-300``text-foreground`
- Button selected state: `bg-white/5 border-brand-500 text-white``bg-accent border-brand-500 text-foreground`
- Button default state: `bg-zinc-950/50 border-white/10 text-zinc-400``bg-input border-border text-muted-foreground`
- Helper text: `text-zinc-500``text-muted-foreground`
2. **Back to Home Button** - Updated to use theme variables:
- `bg-white/5 hover:bg-white/10 text-white border border-white/10``bg-secondary hover:bg-accent text-secondary-foreground border border-border`
3. **API Key Help Text** (2 locations) - Updated muted text color:
- `text-zinc-500``text-muted-foreground`
These changes ensure the Settings View now properly respects all 12+ themes defined in the application (dark, light, retro, dracula, nord, monokai, tokyonight, solarized, gruvbox, catppuccin, onedark, synthwave).
The feature is now in `waiting_approval` status for manual review since `skipTests=true`.✅ Verifying implementation for: Fix the design of this section to use the theme we have elsewhere
Verifying implementation and checking test results...
✓ Verification successful: All tests passed
📝 Committing changes for: Fix the design of this section to use the theme we have elsewhere
I'll help you commit the current changes with a proper conventional commit message. Let me start by examining the current state of the repository and the actual changes made.
🔧 Tool: Bash
🔧 Tool: Bash
🔧 Tool: Bash
Now I can see the current state and recent commit history. Let me stage the changes and create a proper conventional commit message:
🔧 Tool: Bash
Now I'll create the commit with a proper conventional commit message. Based on the git diff analysis, the main changes are related to updating feature status and documentation in the `.automaker` directory. The key change is updating the status of the project dropdown toggle feature from "waiting_approval" to "verified". I'll use the conventional commit format with an appropriate scope and description:
🔧 Tool: Bash
Perfect! Let me verify the commit was successful:
🔧 Tool: Bash
I notice there are still some uncommitted changes to the agent context files. Let me check what these changes are and commit them as well:
🔧 Tool: Bash
These are just additional context logs from the agent execution. Let me stage and commit these final changes:
🔧 Tool: Bash
Excellent! Let me run a final git status to confirm everything is committed:
🔧 Tool: Bash
I see there are still some changes (likely from this current commit workflow being added to the context logs). Let me make one final commit to capture these:
🔧 Tool: Bash

View File

@@ -65,3 +65,53 @@ Starting code implementation...
🔧 Tool: Bash
🔧 Tool: Read
🔧 Tool: Bash
🔧 Tool: Read
Now I have a good understanding of the codebase. Let me read the specific files to see the exact structure of the add and edit feature dialogs:
🔧 Tool: Read
Now I have a clear understanding of both dialogs. I need to:
1. In the **Add Feature Dialog** (lines 1342-1419): Move the Description field before the Category field
2. In the **Edit Feature Dialog** (lines 1452-1536): Move the Description field before the Category field
Let me make these edits:
🔧 Tool: Edit
Now let me update the Edit Feature Dialog similarly:
🔧 Tool: Edit
Both dialogs have been updated. Now let me verify the changes are correct by reading the updated sections:
🔧 Tool: Read
Now let me verify the edit dialog changes:
🔧 Tool: Read
Both dialogs have been successfully updated. The changes are:
1. **Add New Feature Dialog**:
- Description field now comes first
- Category field now comes second with label "Category (optional)"
2. **Edit Feature Dialog**:
- Description field now comes first
- Category field now comes second with label "Category (optional)"
Now let me mark this feature as verified using the UpdateFeatureStatus tool:
🔧 Tool: mcp__automaker-tools__UpdateFeatureStatus
I've completed the feature implementation. Here's a summary of what was done:
## Changes Made
**File Modified:** `app/src/components/views/board-view.tsx`
### Add New Feature Dialog (lines 1342-1368)
- Moved **Description** field to the first position (was second)
- Moved **Category** field to the second position (was first)
- Updated Category label from "Category" to "Category (optional)"
### Edit Feature Dialog (lines 1452-1482)
- Moved **Description** field to the first position (was second)
- Moved **Category** field to the second position (was first)
- Updated Category label from "Category" to "Category (optional)"
The feature has been marked as `waiting_approval` (automatically converted from `verified` because `skipTests=true`). Please manually verify the changes and commit when ready.✅ Verifying implementation for: switch the order inside the add new feature panel so descriptino comes first followed by an optional category, also update the edit feature panel.
Verifying implementation and checking test results...
✓ Verification successful: All tests passed

View File

@@ -0,0 +1,139 @@
📋 Planning implementation for: remember the users choice for skip testing and add a setting toggle in settings page to let them change their default when making new tasks. if it's enabled, show the steps to allow user to add manual testing steps. change label from steps to Verification Steps
⚡ Executing implementation for: remember the users choice for skip testing and add a setting toggle in settings page to let them change their default when making new tasks. if it's enabled, show the steps to allow user to add manual testing steps. change label from steps to Verification Steps
Starting code implementation...
🔧 Tool: Glob
Let me look at the project structure more specifically:
🔧 Tool: Glob
🔧 Tool: Read
🔧 Tool: Read
🔧 Tool: Read
Now I have a good understanding of the codebase. Let me implement the feature:
1. Add a `defaultSkipTests` setting to the app store (persisted)
2. Add a toggle in the settings page
3. Update the "Add Feature" dialog to:
- Default skipTests based on user preference
- Show "Verification Steps" label instead of "Steps" when skipTests is enabled
4. Also update the edit dialog label
🔧 Tool: TodoWrite
🔧 Tool: Edit
Input: {
"file_path": "/Users/webdevcody/Workspace/automaker/app/src/store/app-store.ts",
"old_string": " // Kanban Card Display Settings\n kanbanCardDetailLevel: KanbanCardDetailLevel; // Level of detail shown on kanban cards\n}",
"new_string": " // Kanban Card Display Settings\n kanbanCardDetailLevel: KanbanCardDetailLevel; // Level of detail shown on kanban cards\n\n // Feature Default Settings\n defaultSkipTests: boolean; // Default value for skip tests when creating new features\n}"
}
🔧 Tool: Edit
🔧 Tool: Edit
Input: {
"file_path": "/Users/webdevcody/Workspace/automaker/app/src/store/app-store.ts",
"old_string": " maxConcurrency: 3, // Default to 3 concurrent agents\n kanbanCardDetailLevel: \"standard\", // Default to standard detail level\n};",
"new_string": " maxConcurrency: 3, // Default to 3 concurrent agents\n kanbanCardDetailLevel: \"standard\", // Default to standard detail level\n defaultSkipTests: false, // Default to TDD mode (tests enabled)\n};"
}
🔧 Tool: Edit
Now I need to add `defaultSkipTests` to the persisted state:
🔧 Tool: Edit
🔧 Tool: TodoWrite
Now let me add the toggle in the settings page. I'll add a new section for Feature Defaults:
🔧 Tool: Read
🔧 Tool: Edit
🔧 Tool: Edit
Now let me find where I can add the new section. Let me read more of the settings view to find where to add the feature defaults section:
🔧 Tool: Read
Now let me add the Feature Defaults section after the Kanban Card Display section:
🔧 Tool: Edit
🔧 Tool: TodoWrite
Now let me update the board-view.tsx to:
1. Use `defaultSkipTests` as the default value for new features
2. Change the label from "Steps" to "Verification Steps" when skipTests is enabled
🔧 Tool: Read
🔧 Tool: Edit
Now I need to update the newFeature state initialization to use defaultSkipTests. Since it's initialized with a static value, I need to use an effect to sync it when the dialog opens or when defaultSkipTests changes:
🔧 Tool: Read
I need to update the handleAddFeature to reset skipTests to the default value:
🔧 Tool: Edit
Now I also need to make sure the initial state and when dialog opens uses the default. Let me add an effect that resets the form when the dialog opens:
🔧 Tool: Read
I need to add an effect to reset the skipTests when the dialog opens. Let me find a good place to add it:
🔧 Tool: Edit
Now let me update the label from "Steps" to "Verification Steps" when skipTests is enabled. Let me find the Add Feature dialog:
🔧 Tool: Read
I'll now update the label to change dynamically based on skipTests. I also need to:
1. Change the "Steps" label to "Verification Steps" when skipTests is enabled
2. Only show the steps section when skipTests is enabled (based on the requirement "if it's enabled, show the steps to allow user to add manual testing steps")
Let me update the add feature dialog:
🔧 Tool: Edit
🔧 Tool: TodoWrite
Now let me find and update the Edit Feature dialog to also show "Verification Steps" when skipTests is enabled:
🔧 Tool: Read
🔧 Tool: Edit
🔧 Tool: TodoWrite
Now let me verify the implementation is correct by checking that everything compiles. Let me run a quick type check:
🔧 Tool: Bash
The errors are from an example file and API routes, not from the files I modified. The core application code I changed compiles correctly. Let me verify specifically that the files I modified don't have errors:
🔧 Tool: Bash
The errors are in a different file (analysis-view.tsx) that imports from the store but has missing types - not related to my changes. The store, board-view, and settings-view themselves have no type errors.
Let me now mark the feature as verified using the UpdateFeatureStatus tool:
🔧 Tool: mcp__automaker-tools__UpdateFeatureStatus
Let me check if the feature exists in the feature list:
🔧 Tool: Bash
🔧 Tool: Read
The feature list is empty. This could be because the feature is being tracked elsewhere or the file was cleared. Let me clear my todo list and provide a summary of what was implemented:
🔧 Tool: TodoWrite
## Feature Implementation Complete
I have successfully implemented the feature to remember the user's choice for skip testing and added a settings toggle. Here's a summary of the changes made:
### Files Modified:
1. **`app/src/store/app-store.ts`**
- Added `defaultSkipTests: boolean` to the AppState interface
- Added `setDefaultSkipTests: (skip: boolean) => void` action
- Set initial state to `false` (TDD mode by default)
- Added `defaultSkipTests` to the persisted state so it's remembered across sessions
2. **`app/src/components/views/settings-view.tsx`**
- Added `FlaskConical` icon import and `Checkbox` component import
- Added `defaultSkipTests` and `setDefaultSkipTests` from the store
- Added a new "Feature Defaults" section with a toggle for "Skip automated testing by default"
- The toggle is displayed with helpful description text
3. **`app/src/components/views/board-view.tsx`**
- Added `defaultSkipTests` from the store
- Added an effect to sync `skipTests` default when the Add Feature dialog opens
- **Add Feature Dialog**:
- Moved the skip tests checkbox above the steps section
- Steps section now only shows when `skipTests` is enabled
- Changed label from "Steps" to "Verification Steps"
- Changed button from "Add Step" to "Add Verification Step"
- Changed placeholder from "Step X" to "Verification step X"
- **Edit Feature Dialog**:
- Applied the same changes - steps only show when `skipTests` is enabled
- Changed label to "Verification Steps" and button to "Add Verification Step"
- Reset form uses `defaultSkipTests` value after adding a feature
### Behavior:
- Users can set their default preference in Settings → Feature Defaults
- When creating a new feature, the "Skip automated testing" checkbox will be pre-checked based on their preference
- When skip tests is enabled, the "Verification Steps" input section appears, allowing users to add manual testing/verification steps
- The setting persists across browser sessions via localStorage
**Note:** The feature could not be marked as verified via the UpdateFeatureStatus tool because the feature list appears to be empty. Since this is a `skipTests` feature, the user should manually review and commit the changes.✅ Verifying implementation for: remember the users choice for skip testing and add a setting toggle in settings page to let them change their default when making new tasks. if it's enabled, show the steps to allow user to add manual testing steps. change label from steps to Verification Steps
Verifying implementation and checking test results...
✗ Verification: Tests need attention