Skip to content

Commit 8910142

Browse files
authored
Add comprehensive instructions and module index (#33)
* feat(instructions): add comprehensive instructions modules * feat(modules): add comprehensive module index Introduces a new README.md file in the instructions-modules directory that serves as a complete, categorized index of all available instruction modules. This provides a single source of truth for browsing and discovering modules. The module authoring guide and module system documentation have been updated to link to this new index, improving discoverability and helping to prevent the creation of redundant modules. * docs(instructions-modules): expand README with module description Added detailed descriptions to each module in the README for clarity and usability.
1 parent d19ffe9 commit 8910142

179 files changed

Lines changed: 5485 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/module_authoring_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Module Authoring & Development Guide
22

3-
- [Module Authoring \& Development Guide](#module-authoring--development-guide)
3+
- [Module Authoring & Development Guide](#module-authoring--development-guide)
44
- [1. Introduction](#1-introduction)
55
- [2. Module Structure](#2-module-structure)
66
- [2.1. YAML Frontmatter](#21-yaml-frontmatter)
@@ -128,7 +128,7 @@ Follow this systematic process to create new, high-quality modules. This workflo
128128

129129
### Step 1: Deconstruct the Concept
130130

131-
- Identify the Core Concept: What is the single, atomic idea this module will represent?
131+
- Identify the Core Concept: What is the single, atomic idea this module will represent? Before you begin, review the [existing module library](../instructions-modules/README.md:1) to ensure your concept is not redundant.
132132
- Formulate the Primary Directive: What is the one command it gives the AI?
133133
- Outline the Process: What are the logical steps to achieve this directive?
134134
- Define the Constraints: How could this rule be misinterpreted? What are the explicit anti-patterns to forbid?

docs/module_system.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ A module should be:
3333

3434
This principle means we use specific, descriptive filenames (e.g., `deductive-reasoning.md`) and strictly avoid generic "bucket" files (e.g., `basics.md`). The module file system is a **library of specific concepts**, and the persona file is the **composition tool** used to assemble them.
3535

36+
A complete, categorized list of all available modules can be found in the [`instructions-modules/README.md`](../instructions-modules/README.md:1) file.
37+
3638
## 3. The Grand Architecture: The Four-Tier System
3739

3840
The module system is organized into a four-tier hierarchy. This structure creates a "waterfall of abstraction," guiding the AI from the most universal rules of thought down to the most concrete actions. For maximum effectiveness, personas should always be assembled in the `Foundation -> Principle -> Technology -> Execution` order.

instructions-modules/README.md

Lines changed: 249 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: 'Playbook: Verify and Comment Documentation'
3+
description: 'A step-by-step process for auditing documentation against a codebase.'
4+
---
5+
6+
## Primary Directive
7+
8+
Audit project's documentation file(s) against its codebase and comment out any hallucinated features.
9+
10+
## Process
11+
12+
1. **Read the Documentation**
13+
- Review the documentation file section by section.
14+
15+
2. **Verify Each Feature**
16+
- For each documented feature, property, or function, check if it exists in the source code.
17+
18+
3. **Identify Discrepancies**
19+
- If a documented feature does not exist in the code, label it as a "hallucinated feature."
20+
21+
4. **Isolate and Comment**
22+
- Wrap the entire markdown section for each hallucinated feature in HTML comment tags.
23+
- The comment must start with `<!-- HALLUCINATION:` and end with `-->`.
24+
25+
5. **Propose the Change**
26+
- Present the modified documentation file for approval, with all non-existent features correctly commented out.
27+
28+
## Constraints
29+
30+
- You MUST ONLY wrap hallucinated features in `<!-- HALLUCINATION: ... -->` comment blocks.
31+
- You MUST NOT modify or comment out features that exist in the codebase.
32+
- The output MUST be a documentation file with hallucinated features commented out as specified.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: 'Debug an Issue'
3+
description: 'A systematic playbook for debugging, leveraging foundational modules like root-cause-analysis and causal-reasoning.'
4+
tags:
5+
- execution
6+
- playbook
7+
- debugging
8+
- root-cause-analysis
9+
---
10+
11+
# Playbook: Debug an Issue
12+
13+
## Primary Directive
14+
15+
You MUST follow a systematic process to identify, understand, and resolve the root cause of a bug, not just its symptoms.
16+
17+
## Process
18+
19+
1. **Reproduce the Bug:**
20+
- Identify the exact steps to reproduce the issue consistently.
21+
- If possible, write a failing automated test that captures the bug before you begin fixing it. This test will serve as your validation.
22+
2. **Formulate a Hypothesis (Abductive Reasoning):**
23+
- Based on the observed symptoms, form a hypothesis about the most likely cause.
24+
- Ask: "What is the simplest explanation for why this is failing?"
25+
3. **Isolate the Fault (Causal Reasoning):**
26+
- Gather more data by adding logging, using a debugger, or simplifying the code path.
27+
- Use techniques like `git bisect` to find the exact commit that introduced the bug.
28+
- Narrow down the location of the fault until you have identified the specific lines of code responsible.
29+
4. **Identify the Root Cause (Root Cause Analysis):**
30+
- Once you've found the fault, ask "why" it occurred. Was it a typo? A flawed logical assumption? A misunderstanding of an API?
31+
- Continue asking "why" until you have identified the fundamental reason for the error.
32+
5. **Implement and Verify the Fix:**
33+
- Design a fix that addresses the identified root cause.
34+
- If you wrote a failing test in step 1, ensure your fix makes it pass. If not, write a test now.
35+
- Run all related tests to ensure your fix has not introduced any regressions.
36+
37+
## Constraints
38+
39+
- Do NOT fix only the symptom. A fix MUST address the root cause.
40+
- A bug fix is not complete until there is an automated test that proves the bug is fixed and prevents it from recurring.
41+
- Do NOT make assumptions; use data from logging or a debugger to prove your hypothesis.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: 'Design Microservices Architecture'
3+
description: 'A playbook for designing a system based on the microservices architectural style.'
4+
tags:
5+
- architecture
6+
- microservices
7+
- playbook
8+
- design
9+
---
10+
11+
# Design Microservices Architecture
12+
13+
## Primary Directive
14+
15+
Given a set of business requirements, you MUST generate a high-level design for a microservices architecture that adheres to the principles of loose coupling and high cohesion.
16+
17+
## Process
18+
19+
1. **Identify Bounded Contexts:** Analyze the requirements using Domain-Driven Design principles to identify the core business domains. These will form the boundaries of your microservices.
20+
2. **Define Service APIs:** For each identified service, define its public API contract. Specify the commands it accepts, the queries it answers, and the events it emits.
21+
3. **Plan Data Ownership:** Each service MUST own its own data. Define the data schema for each service and explicitly forbid direct database access between services.
22+
4. **Select Communication Patterns:** Propose a communication strategy. Use synchronous APIs (e.g., REST, gRPC) for queries and commands that require an immediate response. Use asynchronous events (e.g., via a message queue) for notifications and to decouple services.
23+
5. **Address Cross-Cutting Concerns:** Outline a strategy for handling cross-cutting concerns like service discovery, configuration management, authentication/authorization, and distributed tracing.
24+
25+
## Constraints
26+
27+
- The proposed design MUST avoid creating a "distributed monolith" where services are chatty and tightly coupled.
28+
- The number of services should be justified; do not decompose the system more than necessary.
29+
- The design MUST include a plan for observability (logging, metrics, tracing) from day one.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: 'Document a Function'
3+
description: 'A playbook for writing comprehensive documentation for a given function, including its parameters, return value, and potential errors.'
4+
tags:
5+
- execution
6+
- playbook
7+
- documentation
8+
- functions
9+
---
10+
11+
# Playbook: Document a Function
12+
13+
## Primary Directive
14+
15+
You MUST generate comprehensive and clearly-structured documentation for any given function, following a standard format that covers its purpose, parameters, return value, and potential errors.
16+
17+
## Process
18+
19+
1. **Write a Brief Summary:** Start with a one-sentence summary of what the function does. This should be clear and concise.
20+
2. **Describe Parameters:**
21+
- List each parameter on a new line.
22+
- For each parameter, specify its name, expected data type, and a clear description of what it represents.
23+
- Indicate if the parameter is optional and what its default value is.
24+
3. **Describe the Return Value:**
25+
- Specify the data type of the value the function returns.
26+
- Describe what the returned value represents.
27+
- If the function returns different types or values under different conditions, document them.
28+
4. **Document Potential Errors/Exceptions:**
29+
- List the types of errors or exceptions the function might throw.
30+
- For each error, describe the conditions under which it would occur.
31+
5. **Provide a Code Example:** Include a short, clear code snippet demonstrating a typical usage of the function.
32+
33+
## Constraints
34+
35+
- The documentation MUST be written in a format compatible with standard documentation generators for the target language (e.g., JSDoc, TSDoc, Python Docstrings).
36+
- Do NOT describe the implementation details of the function in the documentation; focus on what the user needs to know to use it.
37+
- Every parameter and the return value MUST be documented.
38+
- If the function has no parameters or does not return a value, this MUST be stated explicitly.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: 'Generate New Instruction Module'
3+
description: "A playbook that orchestrates the creation of a new, well-structured instruction module based on a user's request."
4+
tags:
5+
- workflow
6+
- playbook
7+
- generate
8+
- create
9+
- module author
10+
---
11+
12+
# Generate New Instruction Module
13+
14+
## Primary Directive
15+
16+
You will generate a complete, well-structured, and machine-centric instruction module based on the user's provided concept.
17+
18+
## Process
19+
20+
1. **Acknowledge and Deconstruct:** Acknowledge the user's request. Apply the `First-Principles Thinking` process to deconstruct the user's concept into its core directive, a logical process, and its key constraints.
21+
2. **Draft Content:** Generate the content for the new module, adhering strictly to the following:
22+
- The format MUST follow the `Module Structure Standard`.
23+
- The language MUST follow the `Machine-Centric Language` style guide.
24+
3. **Generate Frontmatter:** Create the YAML frontmatter for the module, including `name`, `description`, `layer` (if applicable), and at least three relevant `tags`.
25+
4. **Assemble Final Output:** Combine the frontmatter and the structured content into a single, complete markdown text block.
26+
5. **Present for Review:** Output the final, complete module content. Your task is complete upon presenting the generated module.
27+
28+
## Constraints
29+
30+
- You MUST generate the content yourself based on your understanding of the concept. Do not ask the user to provide the content for the sections.
31+
- Do not invent concepts or directives not implied by the user's request. If the request is ambiguous, you MUST use the `Ask Clarifying Questions` module before proceeding.
32+
- Your final output for this task MUST be only the complete markdown content of the new module file, including frontmatter. Do not wrap it in conversational text.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: 'Generate New Persona Module'
3+
description: "A playbook for generating a new, complete persona file from a user's concept."
4+
---
5+
6+
## Primary Directive
7+
8+
You MUST generate a complete, well-structured persona file based on the user's provided concept.
9+
10+
## Process
11+
12+
1. **Acknowledge and Deconstruct:** Acknowledge the user's request. Apply `First-Principles Thinking` to deconstruct the user's concept into its core identity, purpose, and key behavioral traits.
13+
2. **Define Persona Structure:** The persona will be defined in a JSON file with the following primary keys:
14+
- `name`: A descriptive, unique name for the persona.
15+
- `description`: A concise, one-sentence summary of the persona's purpose.
16+
- `modules`: An array of strings, where each string is the path to an instruction module file that defines a specific behavior or principle.
17+
- `tags`: An array of relevant keywords.
18+
3. **Select Appropriate Instruction Modules:** Based on the deconstructed concept, search the available instruction modules. Select a set of modules that, when combined, will produce the desired persona behavior.
19+
4. **Assemble the Persona JSON:** Construct the final JSON object. Populate the `name`, `description`, and `tags`. For the `modules` array, add the file paths of all selected modules.
20+
5. **Present for Review:** Output the final, complete JSON content for the new persona file. Your task is complete upon presenting the generated file.
21+
22+
## Constraints
23+
24+
- You MUST generate the content yourself based on your understanding of the concept. Do not ask the user to provide the content for the JSON file.
25+
- Do not invent concepts or behaviors not implied by the user's request.
26+
- If the request is ambiguous, you MUST use the `Ask Clarifying Questions` module before proceeding.
27+
- Your final output for this task MUST be only the complete JSON content of the new persona file. Do not wrap it in conversational text.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: 'Lint Persona File'
3+
description: "A playbook to analyze a persona's module list and generate a comprehensive quality and consistency report."
4+
tags:
5+
- lint
6+
- validation
7+
- report
8+
- playbook
9+
---
10+
11+
# Lint Persona File
12+
13+
## Primary Directive
14+
15+
You MUST analyze the provided list of module IDs and generate a structured report detailing any violations of architectural best practices, potential conflicts, or structural inconsistencies.
16+
17+
## Process
18+
19+
1. **Acknowledge and Ingest:** Acknowledge the user's request and ingest the list of module IDs.
20+
2. **Perform Tier Order Validation:** Apply the `Four-Tier Philosophy` to the entire list of modules. Record any violations.
21+
3. **Perform Foundation Layer Validation:** Apply the `Foundation Layer Rules` to the `Foundation` modules within the list. Record any violations.
22+
4. **Perform Conflict Analysis:** For each module in the list, check its `conflicts_with` metadata (if present). Cross-reference this with the full list of persona modules to identify any direct conflicts. Record any findings.
23+
5. **Synthesize Report:** Generate a final report in Markdown format. The report MUST contain the following sections:
24+
- `## Persona Linting Report`
25+
- `### 🚨 Critical Warnings`: Detail any Tier Order or Foundation Layer violations.
26+
- `### ⚠️ Potential Conflicts`: Detail any conflicts found via the `conflicts_with` metadata.
27+
- `### ✅ Analysis Complete`: A concluding statement.
28+
29+
## Constraints
30+
31+
- Your analysis MUST be objective and based only on the rules defined in your loaded modules.
32+
- If no issues are found, the report should state "No issues found." under each section.
33+
- Your final output MUST be only the structured report.

0 commit comments

Comments
 (0)