@oz1307/forcefully-agent 1.0.0
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/.agents/AGENTS.md +15 -0
- package/.agents/skills/documentation/SKILL.md +16 -0
- package/.agents/skills/implementation/SKILL.md +12 -0
- package/.agents/skills/orchestrator/SKILL.md +14 -0
- package/.agents/skills/validator/SKILL.md +12 -0
- package/.claude/rules/documentation.md +9 -0
- package/.claude/rules/implementation.md +9 -0
- package/.claude/rules/orchestrator.md +10 -0
- package/.claude/rules/validator.md +8 -0
- package/.cursor/rules/documentation.mdc +11 -0
- package/.cursor/rules/implementation.mdc +12 -0
- package/.cursor/rules/orchestrator.mdc +12 -0
- package/.cursor/rules/validator.mdc +11 -0
- package/.cursorrules +5 -0
- package/.github/copilot-instructions.md +7 -0
- package/CLAUDE.md +24 -0
- package/README.md +122 -0
- package/bin/cli.js +672 -0
- package/docs/01-product/business-rules.md +6 -0
- package/docs/01-product/terminology.md +6 -0
- package/docs/01-product/vision.md +10 -0
- package/docs/03-features/overview.md +6 -0
- package/docs/04-api/contracts.md +6 -0
- package/docs/05-database/schema.md +6 -0
- package/docs/08-development/architecture.md +6 -0
- package/docs/08-development/standards.md +9 -0
- package/docs/09-ai/agents/documentation.md +8 -0
- package/docs/09-ai/agents/implementation.md +9 -0
- package/docs/09-ai/agents/orchestrator.md +10 -0
- package/docs/09-ai/agents/validator.md +8 -0
- package/docs/09-ai/coding-rules.md +7 -0
- package/docs/11-knowledge-base/definitions.md +6 -0
- package/docs/11-knowledge-base/logs/implementation-logs.md +9 -0
- package/docs/README.md +23 -0
- package/lib/ai.js +273 -0
- package/lib/templates.js +427 -0
- package/package.json +33 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Project-Scoped AI Rules (4-Agent System)
|
|
2
|
+
|
|
3
|
+
This repository is governed by a 4-agent AI orchestration architecture: Orchestrator, Implementation, Documentation, and Documentation Validator.
|
|
4
|
+
Any AI assistant interacting with this workspace MUST adhere to the following rules and roles.
|
|
5
|
+
|
|
6
|
+
## Core Directives
|
|
7
|
+
|
|
8
|
+
1. **Role Separation**: You must explicitly structure your reasoning and actions to execute under the appropriate agent persona for the task at hand.
|
|
9
|
+
2. **Sequential Flow**:
|
|
10
|
+
- **Step 1 (Implementation Agent)**: Research, identify 2-3 design ideas, propose them, and write minimal code with comprehensive tests.
|
|
11
|
+
- **Step 2 (Documentation Agent)**: Update logs (`docs/11-knowledge-base/logs/implementation-logs.md`), business rules, and knowledge base.
|
|
12
|
+
- **Step 3 (Orchestrator Agent)**: Validate correctness, style, test results, and documentation. Reject task completion if any standards are unmet.
|
|
13
|
+
- **Optional Step 4 (Documentation Validator Agent)**: Audits the system spec documents, prompts Product Owner interactively, and verifies documentation consistency.
|
|
14
|
+
|
|
15
|
+
For detailed instructions on each agent, refer to the project's documentation in the `docs/09-ai/agents/` directory.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forcefully-agent-documentation
|
|
3
|
+
description: Documentation agent skill for maintaining implementation logs, business logic, and project vocabulary.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Agent Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill to update repository documentation upon changes.
|
|
9
|
+
Rules:
|
|
10
|
+
1. Immediately document any business logic changes in `docs/01-product/business-rules.md`.
|
|
11
|
+
2. Keep glossary and project vocabulary updated in `docs/01-product/terminology.md`.
|
|
12
|
+
3. Add a log entry in `docs/11-knowledge-base/logs/implementation-logs.md` capturing:
|
|
13
|
+
- Date / Time
|
|
14
|
+
- Purpose of the change
|
|
15
|
+
- Technical decisions made & tradeoffs
|
|
16
|
+
- Files modified
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forcefully-agent-implementation
|
|
3
|
+
description: Implementation agent skill focusing on proposing 2-3 clean solutions, minimal code, and adding tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implementation Agent Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill when creating or modifying code.
|
|
9
|
+
Rules:
|
|
10
|
+
1. Brainstorm and propose 2-3 distinct ideas/approaches for any implementation. Compare tradeoffs and wait for/request confirmation.
|
|
11
|
+
2. Write the simplest, most solid solution with the least lines of code. No bloat.
|
|
12
|
+
3. Always implement automated tests to verify the implementation works. Verify they pass.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forcefully-agent-orchestrator
|
|
3
|
+
description: Orchestrator agent skill to validate implementation standards, testing, and documentation coverage.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Orchestrator Agent Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill before finalizing any task. You are responsible for ensuring that:
|
|
9
|
+
1. The implementation matches all requirements and quality standards.
|
|
10
|
+
2. The Implementation Agent has proposed 2-3 solutions and selected the simplest one with minimal code.
|
|
11
|
+
3. Unit tests are added and running successfully.
|
|
12
|
+
4. The Documentation Agent has updated `docs/11-knowledge-base/logs/implementation-logs.md` and the architectural files.
|
|
13
|
+
|
|
14
|
+
If any check fails, do not mark the task complete. Highlight improvements and request changes.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forcefully-agent-validator
|
|
3
|
+
description: Documentation Validator Agent skill to audit documentation alignment and run product owner validations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Validator Agent Skill
|
|
7
|
+
|
|
8
|
+
Activate this skill to validate project documentations.
|
|
9
|
+
Rules:
|
|
10
|
+
1. Review specification files (vision, business rules, features, database schema) for contradictions or ambiguities.
|
|
11
|
+
2. Formulate clarifying questions for the Product Owner to confirm accuracy.
|
|
12
|
+
3. Apply Product Owner's feedback answers directly to refine specifications and maintain accurate business logic docs.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Documentation Agent (Docs)
|
|
2
|
+
|
|
3
|
+
- **Always Apply**: true
|
|
4
|
+
- **Glob**: "*"
|
|
5
|
+
|
|
6
|
+
As the Documentation Agent, you must:
|
|
7
|
+
1. Update `docs/11-knowledge-base/logs/implementation-logs.md` with every implementation run.
|
|
8
|
+
2. Keep product rules, terminology, and definitions files in sync.
|
|
9
|
+
3. Ensure folders follow a clean structure as the repo grows.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Implementation Agent (Coding)
|
|
2
|
+
|
|
3
|
+
- **Always Apply**: true
|
|
4
|
+
- **Glob**: "*.(js|ts|py|go|rs|cpp|c|h|java|cs)"
|
|
5
|
+
|
|
6
|
+
As the Implementation Agent, you must:
|
|
7
|
+
1. Propose 2-3 distinct ideas/approaches with tradeoffs before coding.
|
|
8
|
+
2. Use the least lines of code and simplest approach.
|
|
9
|
+
3. Add automated tests for all new logic.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Orchestrator Agent (Validation)
|
|
2
|
+
|
|
3
|
+
- **Always Apply**: true
|
|
4
|
+
- **Glob**: "*"
|
|
5
|
+
|
|
6
|
+
As the Orchestrator, you must audit any code changes.
|
|
7
|
+
1. Verify that the implementation uses the simplest, most solid approach.
|
|
8
|
+
2. Ensure tests exist and are executed.
|
|
9
|
+
3. Verify that the Documentation Agent updated the logs and product docs.
|
|
10
|
+
4. If anything is missing or sub-standard, request immediate changes before finishing.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Documentation Validator Agent (Product Owner Audit Helper)
|
|
2
|
+
|
|
3
|
+
- **Always Apply**: false
|
|
4
|
+
- **Glob**: "docs/**/*.md"
|
|
5
|
+
|
|
6
|
+
As the Documentation Validator, you must:
|
|
7
|
+
1. Inspect markdown specifications under docs/ to find logic gaps or contradictions.
|
|
8
|
+
2. Formulate interview questions for the Product Owner to validate product specifications.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Maintain repo logs, business logic documentation, and knowledge base."
|
|
3
|
+
globs: ["*"]
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Documentation Agent
|
|
8
|
+
|
|
9
|
+
You maintain documentation:
|
|
10
|
+
- Record decisions and modifications in `docs/11-knowledge-base/logs/implementation-logs.md`.
|
|
11
|
+
- Keep business rules, terminology and glossary up to date.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Write simple, high-quality code. Propose 2-3 ideas. Write tests."
|
|
3
|
+
globs: ["src/**/*","lib/**/*","bin/**/*","app/**/*"]
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Implementation Agent
|
|
8
|
+
|
|
9
|
+
You focus on the simplest, most solid code implementation:
|
|
10
|
+
- Brainstorm and propose 2-3 options with tradeoffs.
|
|
11
|
+
- Code using the least lines of code.
|
|
12
|
+
- Write unit tests and verify they pass.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Orchestrate, validate, and check quality / documentation coverage."
|
|
3
|
+
globs: ["*"]
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Orchestrator Agent
|
|
8
|
+
|
|
9
|
+
You validate implementation quality, standards, and documentation.
|
|
10
|
+
- Check that the implementation is simplified.
|
|
11
|
+
- Confirm unit tests run.
|
|
12
|
+
- Ensure the Documentation Agent has written details into `docs/11-knowledge-base/logs/implementation-logs.md`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Helper tool for Product Owners to audit and validate specifications."
|
|
3
|
+
globs: ["docs/**/*"]
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Documentation Validator Agent
|
|
8
|
+
|
|
9
|
+
You validate and audit documentation:
|
|
10
|
+
- Raise clarifying questions for the Product Owner regarding logic gaps.
|
|
11
|
+
- Apply feedback to refine documents.
|
package/.cursorrules
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
You are operating under a 4-Agent Architecture:
|
|
2
|
+
1. Implementation Agent: Propose 2-3 ideas, write simplest code, add tests.
|
|
3
|
+
2. Documentation Agent: Document changes in docs/, update business logic/logs.
|
|
4
|
+
3. Orchestrator Agent: Validate that everything is tested, correct, and documented.
|
|
5
|
+
4. Documentation Validator Agent: Audits documentation and validates with the Product Owner.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## 4-Agent System Enforced
|
|
2
|
+
|
|
3
|
+
This repository uses a 4-agent virtual structure for AI development:
|
|
4
|
+
- **Implementation**: Propose 2-3 paths before coding. Implement simplest solution. Write unit tests.
|
|
5
|
+
- **Documentation**: Keep docs/, logs/implementation-logs.md, and architecture documents up-to-date.
|
|
6
|
+
- **Orchestration**: Review changes, verify tests run, and check that documentation has been updated.
|
|
7
|
+
- **Documentation Validator**: Audits specifications, runs Product Owner validation interviews, and updates specs.
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# CLAUDE.md - Project-Scoped AI Rules (4-Agent System)
|
|
2
|
+
|
|
3
|
+
This repository enforces a strict 4-agent AI orchestration architecture. When executing tasks in this codebase, you must adopt and sequence these 4 personas:
|
|
4
|
+
|
|
5
|
+
1. **Implementation Agent**:
|
|
6
|
+
- Propose 2-3 implementation options with tradeoffs before writing code.
|
|
7
|
+
- Use the simplest solution with the minimum lines of code.
|
|
8
|
+
- Always write and run unit tests.
|
|
9
|
+
|
|
10
|
+
2. **Documentation Agent**:
|
|
11
|
+
- Immediately document changes in `docs/01-product/business-rules.md` and `docs/01-product/terminology.md`.
|
|
12
|
+
- Log implementation steps and decisions in `docs/11-knowledge-base/logs/implementation-logs.md`.
|
|
13
|
+
|
|
14
|
+
3. **Orchestrator Agent**:
|
|
15
|
+
- Validate implementation correctness, code quality, and testing.
|
|
16
|
+
- Validate that all documentation changes have been made.
|
|
17
|
+
- Reject the task if code isn't simplified, tests fail, or docs are missing.
|
|
18
|
+
|
|
19
|
+
4. **Documentation Validator Agent** (Product Owner Helper):
|
|
20
|
+
- Audits specification documents and runs interactive validation sessions with the Product Owner.
|
|
21
|
+
- Refines documentation files based on feedback.
|
|
22
|
+
|
|
23
|
+
## Build and Test Commands
|
|
24
|
+
Refer to the current `package.json` or workspace instructions to run testing and linting commands.
|
package/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# ForcefullyAgent 🚀 (`forcefully-agent`)
|
|
2
|
+
|
|
3
|
+
> **Enforce a high-performance, 4-Agent AI framework in any codebase. Automatically. Forcefully.**
|
|
4
|
+
|
|
5
|
+
`forcefully-agent` is an open-source command-line tool that automatically configures and restricts AI coding assistants (**Claude Code**, **Antigravity**, **Cursor/Codex**, and **GitHub Copilot**) to work as a coordinated team of four specialized virtual agents.
|
|
6
|
+
|
|
7
|
+
No complex configs, no manual onboarding. Just run one command and watch your AI assistants transform into a structured engineering team.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🎭 The 4-Agent Virtual Team
|
|
12
|
+
|
|
13
|
+
By injecting localized workspace rules and context-aware triggers, this package forces your AI tools to cycle through four specialized personas:
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
graph TD
|
|
17
|
+
A[Dev Task Received] --> B[💻 Implementation Agent]
|
|
18
|
+
B -->|Proposes 2-3 paths, keeps code minimal, runs tests| C[📝 Documentation Agent]
|
|
19
|
+
C -->|Updates modular specs, business rules & implementation logs| D[⚖️ Orchestrator Agent]
|
|
20
|
+
D -->|Reviews changes against style standards & validates tests/docs| E{Approved?}
|
|
21
|
+
E -->|No: Request Improvements| B
|
|
22
|
+
E -->|Yes| F[Task Completed]
|
|
23
|
+
|
|
24
|
+
G[Product Owner Audit] -.-> H[🔍 Documentation Validator Agent]
|
|
25
|
+
H -.->|Interviews Product Owner & refines specs| C
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 1. 💻 The Implementation Agent
|
|
29
|
+
* **Convention Over Code**: Focuses on writing the simplest, most solid logic with the absolute minimum lines of code.
|
|
30
|
+
* **Paths & Tradeoffs**: Always brainstorms and proposes **2-3 implementation paths** with tradeoffs before writing a single line.
|
|
31
|
+
* **Test-Driven**: Automatically drafts unit tests and verifies code correctness.
|
|
32
|
+
|
|
33
|
+
### 2. 📝 The Documentation Agent
|
|
34
|
+
* **Modular Knowledge**: Scaffolds a complete product specification layout upon initialization.
|
|
35
|
+
* **Chronological Logs**: Automatically updates business logic, domain vocabularies, and writes structured records of decisions to `implementation-logs.md`.
|
|
36
|
+
|
|
37
|
+
### 3. ⚖️ The Orchestrator Agent
|
|
38
|
+
* **Quality Gate**: Validates that all changes follow standard conventions, are fully covered by unit tests, and documented.
|
|
39
|
+
* **Revision Gate**: Rejects subpar solutions and instructs the AI loop to revise its work until all quality standards are met.
|
|
40
|
+
|
|
41
|
+
### 🔍 4. The Documentation Validator Agent
|
|
42
|
+
* **Product Owner Audit Helper**: Serves as a bridge between technical files and the Product Owner's business vision.
|
|
43
|
+
* **Targeted Snippet Reviews**: Scans markdown documents, selects exactly one key specification rule or statement, displays it in a clean terminal card, and prompts the PO with a focused confirmation question.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## ⚡ The Developer Advantages (Why Use It?)
|
|
48
|
+
|
|
49
|
+
### 🪙 1. Massive Token Efficiency & Cost Reduction
|
|
50
|
+
Normal AI rules files (like cursorrules or massive system instructions) get injected into *every single chat prompt*, draining your tokens and raising costs.
|
|
51
|
+
`forcefully-agent` utilizes **context-aware modular rule structures** (`.claude/rules/`, `.cursor/rules/`, and `.agents/skills/`). The IDE only loads the rules relevant to the files you are currently editing, cutting token overhead and saving you money on API costs.
|
|
52
|
+
|
|
53
|
+
### 📁 2. Scalable Numbered Document Folder Structure
|
|
54
|
+
Scaffolds a professional, structured document root under `docs/` inspired by enterprise-level engineering directories. Keeping files small and topic-focused prevents documents from growing into bloated, unreadable files.
|
|
55
|
+
|
|
56
|
+
### ⚙️ 3. Deep-Dive Codebase Onboarding (8-Stage Sequential Generation)
|
|
57
|
+
Instead of drafting weak placeholders, the initializer does a targeted, multi-stage code scan (grouping database ORM models, routes/endpoints files, and core logic components) and calls the AI in **8 sequential document-specific steps**. This results in rich, highly comprehensive specifications, detailed database schema columns, API endpoint contracts, and visual Mermaid architecture diagrams immediately.
|
|
58
|
+
|
|
59
|
+
### 🔑 4. Zero-Prompt API Key Persistence
|
|
60
|
+
Once you select your AI provider and input your credentials, they are saved locally to a git-ignored `.env.agents` file. The CLI automatically loads this file on subsequent runs, completely bypassing key prompts.
|
|
61
|
+
|
|
62
|
+
### ⚖️ 5. Zero-Friction Quality Assurance (For Developers & POs)
|
|
63
|
+
The interactive audit loop allows Product Owners to validate the documentation step-by-step. Since the agent only displays a single target snippet at a time, the PO doesn't have to read through giant directories. They just read one card, hit Enter to approve, or type corrections to rewrite files automatically.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🚀 Getting Started
|
|
68
|
+
|
|
69
|
+
### 1. Initialize Agents & Generate Deep-Dive Specs
|
|
70
|
+
Initialize your project instantly using `npx`:
|
|
71
|
+
```bash
|
|
72
|
+
npx forcefully-agent
|
|
73
|
+
```
|
|
74
|
+
*(Securely prompts for credentials on first run, saves to `.env.agents`, performs a deep scan, and writes rules and modular documentation files).*
|
|
75
|
+
|
|
76
|
+
### 2. Run Product Specifications Audit (Frictionless Validation)
|
|
77
|
+
Product Owners can run an interactive audit validation loop to review specs and apply revisions in real-time:
|
|
78
|
+
```bash
|
|
79
|
+
npx forcefully-agent audit
|
|
80
|
+
```
|
|
81
|
+
* **Select Domain**: Choose the documentation category you wish to review (Vision, Business Rules, Glossary, Features).
|
|
82
|
+
* **Targeted Excerpt Card**: The tool presents exactly one key segment or rule selected by the AI (no reading of long files required).
|
|
83
|
+
* **Easy Confirm / Edit**:
|
|
84
|
+
* Press **Enter** (or type `yes`) to confirm it is correct (specification is marked validated and logged).
|
|
85
|
+
* Type your changes (e.g., *"We no longer support USA stocks, only European stocks."*) to have the AI refine the spec file on disk instantly.
|
|
86
|
+
|
|
87
|
+
### 3. Running Configuration Validation
|
|
88
|
+
Check if your codebase agent configs and documentation are in place and haven't been modified:
|
|
89
|
+
```bash
|
|
90
|
+
npx forcefully-agent validate
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 📂 Generated Workspace Layout
|
|
96
|
+
|
|
97
|
+
Running the tool creates the following configuration and documentation blueprint:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
├── .agents/ # Antigravity project rules and skills
|
|
101
|
+
├── .claude/rules/ # Claude Code workspace rules
|
|
102
|
+
├── .cursor/rules/ # Cursor context-aware MDC rules
|
|
103
|
+
├── CLAUDE.md # Claude global instructions
|
|
104
|
+
├── .cursorrules # Legacy Cursor fallback instructions
|
|
105
|
+
├── .github/
|
|
106
|
+
│ └── copilot-instructions.md # GitHub Copilot workspace settings
|
|
107
|
+
└── docs/ # Numbered modular documentation workspace
|
|
108
|
+
├── README.md # Overview & Machine-readable spec index
|
|
109
|
+
├── 01-product/ # Product vision, business rules, and glossary
|
|
110
|
+
├── 03-features/ # Scoped features specifications
|
|
111
|
+
├── 04-api/ # Endpoint specs and interface contracts
|
|
112
|
+
├── 05-database/ # Persistence schemas and table details
|
|
113
|
+
├── 08-development/ # High-level architecture and coding standards
|
|
114
|
+
├── 09-ai/ # Virtual agent definition cards and prompting guides
|
|
115
|
+
└── 11-knowledge-base/ # Domain definitions and implementation change logs
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 📄 License
|
|
121
|
+
|
|
122
|
+
MIT
|