Skip to Content
Week 2.1: Core Agentic Automation

Week 2.1: Core Agentic Automation


Week 2.1 Resources: Core Agentic Automation

Project Structure Setup

In this lesson, we shift from “vibe coding” to structured automation. We use a specific folder structure to organize our agent’s brain.

  • commands/: Contains .md files that become custom Slash Commands (e.g., /hello).
  • specs/: Contains “Blueprints” for code generation.
  • tools/: Where the agent writes the actual Python code.
  • .claude/: Configuration files (hooks and settings).

Custom Command Files

Create a folder named commands. Create the following Markdown files inside it. These automate repetitive workflows.

1. Basic Argument Handling (commands/hello.md):

user's name: $ARGUMENTS say hello to the user

2. Auto-Commit (commands/commit.md):

Check current file changes and commit with an appropriate message. Don't push.

3. Run Spec (commands/run_spec.md):

FILENAME: $ARGUMENTS Execute the spec in the given filename. Make the implementation clean and minimal.

4. Verify Spec (commands/verify_spec.md):

FILENAME: $ARGUMENTS The spec file at the given filename has been executed. Steps: 1. read the spec file. 2. verify that it has been properly implemented. 3. run the implemented code and verify that it works correctly.

5. Chain of Thought / Full Workflow (commands/run_full_implementation.md): Note: This command chains the previous commands together.

FILENAME: $ARGUMENTS Steps: 1. Run command commands/run_spec.md 2. Run command commands/verify_spec.md 3. Run command commands/commit.md

6. Add Folder to Overview (commands/add_folder_to_project_overview.md):

FOLDER: $ARGUMENTS Steps: 1. Investigate the specified folder. - Understand the structure and purpose 2. update docs/project_overview.md - update "Folders" section - Add the specified folder with a brief description

7. Add Tools to Overview (commands/add_tools_to_project_overview.md):

TOOLS MODULE: $ARGUMENTS Steps: 1. Investigate the specified tools module. - Understand the purpose and functionality of each function - Understand how to run each function from the terminal 2. update docs/project_overview.md - update "Tools" section - Add information about each tool and how to run it from the terminal - Be brief

Configuration Fix (Crucial)

During the lesson, a bug was discovered where Claude stops early when chaining commands. To fix this, you must disable the “Skill” tool in your local settings.

File: .claude/settings.local.json Add the "deny" line to your existing configuration:

{ "permissions": { "allow": [ "bash", "bash (git commit)" ], "deny": ["skill"] }, "preUseTool": { "matcher": "Read|Edit|Write", "command": "python .claude/hooks/block_forbidden_files.py" } }

Spec Files (Blueprints)

Create these files in your specs/ folder to tell the agent exactly what to build.

Image Tools Spec (specs/create_image_tools.md):

CREATE tools/image_tools.py DEF create_image_with_text(file_name, text, width, height) DEF superimpose_text_on_image(file_name, text) DEF create_image_with_random_shapes(file_name, width, height) - use random colors, sizes, and opacity ADD command line arguments for running the functions

Class Prompts & Execution

Use these slash commands in the Claude Code input bar to execute the workflows created above.

Testing Basic Args:

/hello Seth

Running the Full Automation Cycle:

/run_full_implementation specs/create_image_tools.md

Running the Generated Python Tool (Terminal): Once the agent finishes building the tool, you can run it from the terminal to test:

# Example usage of the generated tool python tools/image_tools.py create_image_with_random_shapes output.png 400 300

Adding Tools to Documentation (Self-Documentation):

/add_tools_to_project_overview tools/image_tools.py

Note on .gitignore

Keep your repository clean by ensuring __pycache__ folders are not committed to GitHub.

If you see __pycache__ files in your source control tab:

  1. Open GitHub Desktop (or your git tool).
  2. Right-click the __pycache__ file/folder.
  3. Select “Ignore all .pyc files” (or add *.pyc and __pycache__/ to your .gitignore file manually).
Last updated on