@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.
Files changed (37) hide show
  1. package/.agents/AGENTS.md +15 -0
  2. package/.agents/skills/documentation/SKILL.md +16 -0
  3. package/.agents/skills/implementation/SKILL.md +12 -0
  4. package/.agents/skills/orchestrator/SKILL.md +14 -0
  5. package/.agents/skills/validator/SKILL.md +12 -0
  6. package/.claude/rules/documentation.md +9 -0
  7. package/.claude/rules/implementation.md +9 -0
  8. package/.claude/rules/orchestrator.md +10 -0
  9. package/.claude/rules/validator.md +8 -0
  10. package/.cursor/rules/documentation.mdc +11 -0
  11. package/.cursor/rules/implementation.mdc +12 -0
  12. package/.cursor/rules/orchestrator.mdc +12 -0
  13. package/.cursor/rules/validator.mdc +11 -0
  14. package/.cursorrules +5 -0
  15. package/.github/copilot-instructions.md +7 -0
  16. package/CLAUDE.md +24 -0
  17. package/README.md +122 -0
  18. package/bin/cli.js +672 -0
  19. package/docs/01-product/business-rules.md +6 -0
  20. package/docs/01-product/terminology.md +6 -0
  21. package/docs/01-product/vision.md +10 -0
  22. package/docs/03-features/overview.md +6 -0
  23. package/docs/04-api/contracts.md +6 -0
  24. package/docs/05-database/schema.md +6 -0
  25. package/docs/08-development/architecture.md +6 -0
  26. package/docs/08-development/standards.md +9 -0
  27. package/docs/09-ai/agents/documentation.md +8 -0
  28. package/docs/09-ai/agents/implementation.md +9 -0
  29. package/docs/09-ai/agents/orchestrator.md +10 -0
  30. package/docs/09-ai/agents/validator.md +8 -0
  31. package/docs/09-ai/coding-rules.md +7 -0
  32. package/docs/11-knowledge-base/definitions.md +6 -0
  33. package/docs/11-knowledge-base/logs/implementation-logs.md +9 -0
  34. package/docs/README.md +23 -0
  35. package/lib/ai.js +273 -0
  36. package/lib/templates.js +427 -0
  37. package/package.json +33 -0
@@ -0,0 +1,427 @@
1
+ // Templates for AI configuration and modular documentation files
2
+
3
+ export function getAntigravityAgentsRules() {
4
+ return `# Project-Scoped AI Rules (4-Agent System)
5
+
6
+ This repository is governed by a 4-agent AI orchestration architecture: Orchestrator, Implementation, Documentation, and Documentation Validator.
7
+ Any AI assistant interacting with this workspace MUST adhere to the following rules and roles.
8
+
9
+ ## Core Directives
10
+
11
+ 1. **Role Separation**: You must explicitly structure your reasoning and actions to execute under the appropriate agent persona for the task at hand.
12
+ 2. **Sequential Flow**:
13
+ - **Step 1 (Implementation Agent)**: Research, identify 2-3 design ideas, propose them, and write minimal code with comprehensive tests.
14
+ - **Step 2 (Documentation Agent)**: Update logs (\`docs/11-knowledge-base/logs/implementation-logs.md\`), business rules, and knowledge base.
15
+ - **Step 3 (Orchestrator Agent)**: Validate correctness, style, test results, and documentation. Reject task completion if any standards are unmet.
16
+ - **Optional Step 4 (Documentation Validator Agent)**: Audits the system spec documents, prompts Product Owner interactively, and verifies documentation consistency.
17
+
18
+ For detailed instructions on each agent, refer to the project's documentation in the \`docs/09-ai/agents/\` directory.
19
+ `;
20
+ }
21
+
22
+ export function getAntigravitySkill(agentName) {
23
+ const descriptions = {
24
+ orchestrator: {
25
+ name: "forcefully-agent-orchestrator",
26
+ desc: "Orchestrator agent skill to validate implementation standards, testing, and documentation coverage.",
27
+ body: `# Orchestrator Agent Skill
28
+
29
+ Activate this skill before finalizing any task. You are responsible for ensuring that:
30
+ 1. The implementation matches all requirements and quality standards.
31
+ 2. The Implementation Agent has proposed 2-3 solutions and selected the simplest one with minimal code.
32
+ 3. Unit tests are added and running successfully.
33
+ 4. The Documentation Agent has updated \`docs/11-knowledge-base/logs/implementation-logs.md\` and the architectural files.
34
+
35
+ If any check fails, do not mark the task complete. Highlight improvements and request changes.`
36
+ },
37
+ implementation: {
38
+ name: "forcefully-agent-implementation",
39
+ desc: "Implementation agent skill focusing on proposing 2-3 clean solutions, minimal code, and adding tests.",
40
+ body: `# Implementation Agent Skill
41
+
42
+ Activate this skill when creating or modifying code.
43
+ Rules:
44
+ 1. Brainstorm and propose 2-3 distinct ideas/approaches for any implementation. Compare tradeoffs and wait for/request confirmation.
45
+ 2. Write the simplest, most solid solution with the least lines of code. No bloat.
46
+ 3. Always implement automated tests to verify the implementation works. Verify they pass.`
47
+ },
48
+ documentation: {
49
+ name: "forcefully-agent-documentation",
50
+ desc: "Documentation agent skill for maintaining implementation logs, business logic, and project vocabulary.",
51
+ body: `# Documentation Agent Skill
52
+
53
+ Activate this skill to update repository documentation upon changes.
54
+ Rules:
55
+ 1. Immediately document any business logic changes in \`docs/01-product/business-rules.md\`.
56
+ 2. Keep glossary and project vocabulary updated in \`docs/01-product/terminology.md\`.
57
+ 3. Add a log entry in \`docs/11-knowledge-base/logs/implementation-logs.md\` capturing:
58
+ - Date / Time
59
+ - Purpose of the change
60
+ - Technical decisions made & tradeoffs
61
+ - Files modified`
62
+ },
63
+ validator: {
64
+ name: "forcefully-agent-validator",
65
+ desc: "Documentation Validator Agent skill to audit documentation alignment and run product owner validations.",
66
+ body: `# Documentation Validator Agent Skill
67
+
68
+ Activate this skill to validate project documentations.
69
+ Rules:
70
+ 1. Review specification files (vision, business rules, features, database schema) for contradictions or ambiguities.
71
+ 2. Formulate clarifying questions for the Product Owner to confirm accuracy.
72
+ 3. Apply Product Owner's feedback answers directly to refine specifications and maintain accurate business logic docs.`
73
+ }
74
+ };
75
+
76
+ const choice = descriptions[agentName.toLowerCase()] || descriptions.orchestrator;
77
+ return `---
78
+ name: ${choice.name}
79
+ description: ${choice.desc}
80
+ ---
81
+
82
+ ${choice.body}
83
+ `;
84
+ }
85
+
86
+ export function getClaudeInstructions() {
87
+ return `# CLAUDE.md - Project-Scoped AI Rules (4-Agent System)
88
+
89
+ This repository enforces a strict 4-agent AI orchestration architecture. When executing tasks in this codebase, you must adopt and sequence these 4 personas:
90
+
91
+ 1. **Implementation Agent**:
92
+ - Propose 2-3 implementation options with tradeoffs before writing code.
93
+ - Use the simplest solution with the minimum lines of code.
94
+ - Always write and run unit tests.
95
+
96
+ 2. **Documentation Agent**:
97
+ - Immediately document changes in \`docs/01-product/business-rules.md\` and \`docs/01-product/terminology.md\`.
98
+ - Log implementation steps and decisions in \`docs/11-knowledge-base/logs/implementation-logs.md\`.
99
+
100
+ 3. **Orchestrator Agent**:
101
+ - Validate implementation correctness, code quality, and testing.
102
+ - Validate that all documentation changes have been made.
103
+ - Reject the task if code isn't simplified, tests fail, or docs are missing.
104
+
105
+ 4. **Documentation Validator Agent** (Product Owner Helper):
106
+ - Audits specification documents and runs interactive validation sessions with the Product Owner.
107
+ - Refines documentation files based on feedback.
108
+
109
+ ## Build and Test Commands
110
+ Refer to the current \`package.json\` or workspace instructions to run testing and linting commands.
111
+ `;
112
+ }
113
+
114
+ export function getClaudeRule(agentName) {
115
+ const rules = {
116
+ orchestrator: `# Orchestrator Agent (Validation)
117
+
118
+ - **Always Apply**: true
119
+ - **Glob**: "*"
120
+
121
+ As the Orchestrator, you must audit any code changes.
122
+ 1. Verify that the implementation uses the simplest, most solid approach.
123
+ 2. Ensure tests exist and are executed.
124
+ 3. Verify that the Documentation Agent updated the logs and product docs.
125
+ 4. If anything is missing or sub-standard, request immediate changes before finishing.`,
126
+
127
+ implementation: `# Implementation Agent (Coding)
128
+
129
+ - **Always Apply**: true
130
+ - **Glob**: "*.(js|ts|py|go|rs|cpp|c|h|java|cs)"
131
+
132
+ As the Implementation Agent, you must:
133
+ 1. Propose 2-3 distinct ideas/approaches with tradeoffs before coding.
134
+ 2. Use the least lines of code and simplest approach.
135
+ 3. Add automated tests for all new logic.`,
136
+
137
+ documentation: `# Documentation Agent (Docs)
138
+
139
+ - **Always Apply**: true
140
+ - **Glob**: "*"
141
+
142
+ As the Documentation Agent, you must:
143
+ 1. Update \`docs/11-knowledge-base/logs/implementation-logs.md\` with every implementation run.
144
+ 2. Keep product rules, terminology, and definitions files in sync.
145
+ 3. Ensure folders follow a clean structure as the repo grows.`,
146
+
147
+ validator: `# Documentation Validator Agent (Product Owner Audit Helper)
148
+
149
+ - **Always Apply**: false
150
+ - **Glob**: "docs/**/*.md"
151
+
152
+ As the Documentation Validator, you must:
153
+ 1. Inspect markdown specifications under docs/ to find logic gaps or contradictions.
154
+ 2. Formulate interview questions for the Product Owner to validate product specifications.`
155
+ };
156
+ return rules[agentName.toLowerCase()] || rules.orchestrator;
157
+ }
158
+
159
+ export function getCursorRule(agentName) {
160
+ const rules = {
161
+ orchestrator: {
162
+ desc: "Orchestrate, validate, and check quality / documentation coverage.",
163
+ globs: ["*"],
164
+ body: `# Orchestrator Agent
165
+
166
+ You validate implementation quality, standards, and documentation.
167
+ - Check that the implementation is simplified.
168
+ - Confirm unit tests run.
169
+ - Ensure the Documentation Agent has written details into \`docs/11-knowledge-base/logs/implementation-logs.md\`.`
170
+ },
171
+ implementation: {
172
+ desc: "Write simple, high-quality code. Propose 2-3 ideas. Write tests.",
173
+ globs: ["src/**/*", "lib/**/*", "bin/**/*", "app/**/*"],
174
+ body: `# Implementation Agent
175
+
176
+ You focus on the simplest, most solid code implementation:
177
+ - Brainstorm and propose 2-3 options with tradeoffs.
178
+ - Code using the least lines of code.
179
+ - Write unit tests and verify they pass.`
180
+ },
181
+ documentation: {
182
+ desc: "Maintain repo logs, business logic documentation, and knowledge base.",
183
+ globs: ["*"],
184
+ body: `# Documentation Agent
185
+
186
+ You maintain documentation:
187
+ - Record decisions and modifications in \`docs/11-knowledge-base/logs/implementation-logs.md\`.
188
+ - Keep business rules, terminology and glossary up to date.`
189
+ },
190
+ validator: {
191
+ desc: "Helper tool for Product Owners to audit and validate specifications.",
192
+ globs: ["docs/**/*"],
193
+ body: `# Documentation Validator Agent
194
+
195
+ You validate and audit documentation:
196
+ - Raise clarifying questions for the Product Owner regarding logic gaps.
197
+ - Apply feedback to refine documents.`
198
+ }
199
+ };
200
+
201
+ const choice = rules[agentName.toLowerCase()] || rules.orchestrator;
202
+ return `---
203
+ description: "${choice.desc}"
204
+ globs: ${JSON.stringify(choice.globs)}
205
+ alwaysApply: true
206
+ ---
207
+
208
+ ${choice.body}
209
+ `;
210
+ }
211
+
212
+ export function getCursorRulesLegacy() {
213
+ return `You are operating under a 4-Agent Architecture:
214
+ 1. Implementation Agent: Propose 2-3 ideas, write simplest code, add tests.
215
+ 2. Documentation Agent: Document changes in docs/, update business logic/logs.
216
+ 3. Orchestrator Agent: Validate that everything is tested, correct, and documented.
217
+ 4. Documentation Validator Agent: Audits documentation and validates with the Product Owner.
218
+ `;
219
+ }
220
+
221
+ export function getCopilotInstructions() {
222
+ return `## 4-Agent System Enforced
223
+
224
+ This repository uses a 4-agent virtual structure for AI development:
225
+ - **Implementation**: Propose 2-3 paths before coding. Implement simplest solution. Write unit tests.
226
+ - **Documentation**: Keep docs/, logs/implementation-logs.md, and architecture documents up-to-date.
227
+ - **Orchestration**: Review changes, verify tests run, and check that documentation has been updated.
228
+ - **Documentation Validator**: Audits specifications, runs Product Owner validation interviews, and updates specs.
229
+ `;
230
+ }
231
+
232
+ // ==========================================
233
+ // MODULAR DOCUMENTATION TEMPLATES
234
+ // ==========================================
235
+
236
+ export function getDocsReadme() {
237
+ return `---
238
+ Title: Project Documentation Index
239
+ Owner: Product & Engineering
240
+ Status: Active
241
+ Version: 1.0
242
+ Priority: High
243
+ Tags: index, agent-system
244
+ ---
245
+
246
+ # Project Documentation
247
+
248
+ This documentation workspace is a machine-readable product specification system. It is organized by product domain to keep documents small and focused.
249
+
250
+ ## Domain Index
251
+
252
+ - \`/01-product/\`: Product vision, core business rules, and terminology glossary.
253
+ - \`/02-design-system/\`: UI styling patterns, guidelines, or frontend conventions.
254
+ - \`/03-features/\`: Descriptions and specifications for individual workflows/features.
255
+ - \`/04-api/\`: API endpoint contracts, service endpoints, or edge functions description.
256
+ - \`/05-database/\`: Database schema tables, models, or persistence models.
257
+ - \`/08-development/\`: Codebase system architecture, directories layout, and standards.
258
+ - \`/09-ai/\`: Specification of the 4 virtual agents and repository AI rules.
259
+ - \`/11-knowledge-base/\`: Supporting definitions, glossary records, and historical change logs.
260
+ `;
261
+ }
262
+
263
+ export function getVisionTemplate(analysis) {
264
+ return `# Product Vision
265
+
266
+ This document details the product purpose, target audience, and engineering goals.
267
+
268
+ ## Core Vision
269
+ ${analysis.vision || "We build simple, scalable, and high-performance software."}
270
+
271
+ ## Objectives
272
+ - Standardized AI-first development flow.
273
+ - Maintain simple and minimal codebases.
274
+ `;
275
+ }
276
+
277
+ export function getBusinessRulesTemplate(analysis) {
278
+ return `# Business Rules
279
+
280
+ This document outlines the core business logic rules and restrictions enforced in this codebase.
281
+
282
+ ## Enforced Business Rules
283
+ ${analysis.businessRules || "- Default rule: Adhere to standard logic flows."}
284
+ `;
285
+ }
286
+
287
+ export function getTerminologyTemplate(analysis) {
288
+ return `# Domain Terminology
289
+
290
+ This document contains key terminology, acronyms, and abbreviations used throughout the system.
291
+
292
+ ## Glossary
293
+ ${analysis.terminology || "- **project**: General software codebase."}
294
+ `;
295
+ }
296
+
297
+ export function getFeaturesTemplate(analysis) {
298
+ return `# Features Overview
299
+
300
+ This document lists the core features, components, and workflows in the application.
301
+
302
+ ## Active Features
303
+ ${analysis.features || "- Codebase scanning and initialization."}
304
+ `;
305
+ }
306
+
307
+ export function getApiContractsTemplate(analysis) {
308
+ return `# API Contracts
309
+
310
+ This document outlines backend API endpoints, schemas, service endpoints, or internal library contracts.
311
+
312
+ ## Interface Specifications
313
+ ${analysis.apiContracts || "Standard programming interfaces."}
314
+ `;
315
+ }
316
+
317
+ export function getDatabaseSchemaTemplate(analysis) {
318
+ return `# Database Schema
319
+
320
+ This document details the database tables, models, schemas, or persistence configurations.
321
+
322
+ ## Schema Specifications
323
+ ${analysis.databaseSchema || "No explicit database schema detected."}
324
+ `;
325
+ }
326
+
327
+ export function getArchitectureTemplate(analysis) {
328
+ return `# System Architecture
329
+
330
+ This document describes the high-level system architecture, module relationships, and data flows.
331
+
332
+ ## Architecture Overview
333
+ ${analysis.architecture || "Standard modular architecture layout."}
334
+ `;
335
+ }
336
+
337
+ export function getDevelopmentStandardsTemplate() {
338
+ return `# Coding Standards
339
+
340
+ This document establishes coding guidelines, standards, and quality benchmarks.
341
+
342
+ ## Guidelines
343
+ - Write minimal, self-documenting code.
344
+ - Avoid duplicate logic.
345
+ - Prefer functional paradigms where clear.
346
+ - Do not write TS/JS 'any' types without a strong comment reason.
347
+ `;
348
+ }
349
+
350
+ export function getAgentDoc(agentName) {
351
+ const doc = {
352
+ orchestrator: `# Orchestrator Agent (Orchestration & Validation)
353
+
354
+ The Orchestrator Agent is responsible for ensuring implementation excellence, architectural consistency, and documentation accuracy.
355
+
356
+ ## Workflow
357
+ 1. **Initial Review**: When a request is received, ensure the Implementation Agent proposes multiple options first.
358
+ 2. **Quality Gate**: Review the selected approach. Ensure it is simple, solid, and does not contain bloated or redundant code.
359
+ 3. **Verification**: Verify that tests have been implemented and run successfully.
360
+ 4. **Documentation Audit**: Confirm that the Documentation Agent updated all required files, including implementation logs and business logic documents.
361
+ 5. **Approval**: Approve the task or request iterations if standards are not met.`,
362
+
363
+ implementation: `# Implementation Agent (Coding & Testing)
364
+
365
+ The Implementation Agent is responsible for writing minimal, clean, and testable code.
366
+
367
+ ## Workflow
368
+ 1. **Brainstorming**: Propose 2-3 implementation ideas with pros/cons before touching the codebase.
369
+ 2. **Coding**: Implement the chosen approach using the simplest possible code (least lines of code, standard patterns).
370
+ 3. **Testing**: Write unit/integration tests for any new or modified logic.
371
+ 4. **Execution**: Verify that all tests pass.`,
372
+
373
+ documentation: `# Documentation Agent (Knowledge Base & Logs)
374
+
375
+ The Documentation Agent is responsible for maintaining the system's "source of truth".
376
+
377
+ ## Workflow
378
+ 1. **Knowledge Maintenance**: Ensure the business logic and definitions folder remains updated as new features are added.
379
+ 2. **Change Log**: Record every code implementation task in \`docs/11-knowledge-base/logs/implementation-logs.md\`.
380
+ 3. **Repository Onboarding**: Ensure folder structures remain clean so that new agents or human developers can easily understand the codebase.`,
381
+
382
+ validator: `# Documentation Validator Agent (Product Owner Audit Helper)
383
+
384
+ The Documentation Validator Agent acts as a bridge between technical documentation and the Product Owner's business vision.
385
+
386
+ ## Workflow
387
+ 1. **Document Audit**: Scans and parses the existing markdown documents to identify logical inconsistencies or gaps.
388
+ 2. **Interactivity**: Prompts the Product Owner with clarifying questions regarding requirements, business rules, and terminology.
389
+ 3. **Refinement**: Automatically applies the Product Owner's answers to refine and update the specifications files.`
390
+ };
391
+
392
+ return doc[agentName.toLowerCase()] || doc.orchestrator;
393
+ }
394
+
395
+ export function getCodingRules() {
396
+ return `# AI Coding Rules
397
+
398
+ This repository enforces strict AI coding practices. All AI engines MUST adhere to:
399
+ 1. Propose 2-3 design options with pros/cons before making changes.
400
+ 2. Always write unit tests for new behavior.
401
+ 3. Update \`docs/11-knowledge-base/logs/implementation-logs.md\` with details of every task run.
402
+ 4. Maintain documentation consistency and consult the Documentation Validator Agent if ambiguities arise.
403
+ `;
404
+ }
405
+
406
+ export function getDefinitionsTemplate(analysis) {
407
+ return `# Definitions & Glossary
408
+
409
+ Key system concepts and definitions.
410
+
411
+ ## Key Definitions
412
+ ${analysis.definitions || "- **forcefully-agent**: The AI 3-agent orchestration system."}
413
+ `;
414
+ }
415
+
416
+ export function getImplementationLogsTemplate() {
417
+ return `# Implementation Logs
418
+
419
+ This logbook records all codebase modifications, key architectural decisions, and agent executions.
420
+
421
+ ## [${new Date().toISOString().split('T')[0]}] Initial ForcefullyAgent Setup
422
+ - **Agent**: Documentation Agent
423
+ - **Description**: Configured 4-agent orchestration templates and initialized modular documentation structures.
424
+ - **AI Engine used**: Initial onboarding scanner.
425
+ - **Decisions**: Setup rules for Antigravity, Claude Code, Cursor, and Copilot.
426
+ `;
427
+ }
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@oz1307/forcefully-agent",
3
+ "version": "1.0.0",
4
+ "description": "Automatically configures and enforces a 3-agent AI architecture (Orchestrator, Implementation, Documentation) for Antigravity, Claude Code, Cursor/Codex, and GitHub Copilot.",
5
+ "type": "module",
6
+ "bin": {
7
+ "forcefully-agent": "./bin/cli.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/cli.js",
11
+ "validate": "node bin/cli.js validate",
12
+ "audit": "node bin/cli.js audit",
13
+ "test": "node scratch/test-harness.js"
14
+ },
15
+ "keywords": [
16
+ "ai-agent",
17
+ "orchestration",
18
+ "antigravity",
19
+ "claude-code",
20
+ "cursorrules",
21
+ "copilot-instructions",
22
+ "documentation"
23
+ ],
24
+ "author": "",
25
+ "license": "MIT",
26
+ "dependencies": {
27
+ "@anthropic-ai/sdk": "^0.32.0",
28
+ "@clack/prompts": "^0.7.0",
29
+ "@google/genai": "^2.10.0",
30
+ "dotenv": "^16.4.5",
31
+ "openai": "^4.71.1"
32
+ }
33
+ }