Valmiki (during Lord Rama's time) is celebrated as the poet harbinger in Sanskrit literature. He is the author of the epic Ramayana, based on the attribution in the text of the epic itself. He is revered as the Adi Kavi, which means First Poet, for he discovered the first śloka i.e. first verse, which set the base and defined the form to Sanskrit poetry.
Little is known about the exact childhood of Valmiki, but as to how he came to be known by that name, there is the following account. It involves a younger Valmiki (not known by that name, then) meeting the Sage Narada.
How he became Valmiki
One day Narada Muni was passing by that way when he ran into Ratnakara, who insisted him to give everything he owns, from his clothing to the shoes he was wearing. Narada asked Ratnakara if his family was part of this sin that he was committing and he told him to go ask his family that same question. Ratnakara tied Narada to a tree to make him stay in that same spot until he was back. When Ratnakara asked his parents if they were with him on the sin that he was doing, they replied that it was his job to take care of them, and that only he was responsible for his own sins. His wife also said the same thing. Ratnakara then returned to Narad Muni and fell to his feet. He told him that he alone was responsible for the sins and asked him to help him get rid of the sins he had committed. Narada told him to repeat Lord Rama's name and that would assist him. However, having committed such great sins all his life thus far, Ratnakara could not even pronounce the holy name "Rama". All he could think of and speak of was "mara" (death). So Narada insisted that he keep repeating "mara" until he could say "Rama". Then, after Narada left, Ratnakara went into a deep penance while reciting the Lord's name. Over time as he kept meditating, remaining motionless, an anthill grew around him. After a long penance, a divine light came upon him and said that he was free from all sins, and that he was to be called "Valmiki" from then (Valmiki meaning 'one who sits in an anthill' in Sanskrit).
Writer of the Ramayana
The youthful sage Narada at the white-bearded Valmiki's hermitage
Sita in Valmiki's hermitage
The Rāmāyaṇa, originally written by Valmiki, consists of 24,000 ślokas in seven cantos (some say six i.e. excluding the Uttara Ramayana) (kāṇḍas). The Ramayana tells the story of a prince, Rama of Ayodhya, whose wife Sita is abducted by the demon (Rākshasa) king of Lanka, Rāvana. The Valmiki Ramayana is dated variously from 500 BC to 100 BC, or about co-eval with early versions of the Mahabhārata. As with many traditional epics, it has gone through a long process of interpolations and redactions, making it impossible to date accurately.
Notwithstanding the aforesaid, it is pertinent to note that Valmiki is also quoted to be the contemporary of Rama. Rama met Valmiki during his period of exile and had interacted with him. Valmiki had Sita in his hermitage where Kusa and Lava were born to Sita. Valmiki taught Ramayana to Kusa and Lava, who later sang the divine story in Ayodhya during the Aswamedha yaga congregation, to the pleasure of the audience, whereupon, King Rama summoned them to his royal palace. Kusa and Lava sang the story of Rama there, and Rama confirmed that whatever had been sung by these two children was entirely true.
The first śloka
The Killing of Krouncha Heron
Valmiki was going to the river Ganges for his daily ablutions. A disciple by the name Bharadwaja was carrying his clothes. On the way, they came across the Tamasa Stream. Looking at the stream, Valmiki said to his disciple, "Look, how clear is this water, like the mind of a good man! I will bathe here today." When he was looking for a suitable place to step into the stream, he saw a Crane (bird) couple mating. Valmiki felt very pleased on seeing the happy birds. Suddenly, hit by an arrow; the male bird died on the spot. Filled by sorrow its mate screamed in agony and died of shock. Valmiki's heart melted at this pitiful sight. He looked around to find out who had shot the bird. He saw a hunter with a bow and arrows, nearby. Valmiki became very angry. His lips opened and he uttered the following words:
Emerging spontaneously from his rage and grief, this was the first śloka in Sanskrit literature. Later Valmiki composed the entire Ramayana with the blessings of Lord Brahma in the same meter that issued forth from him as the śloka. Thus this śloka is revered as the "first śloka" in Hindu literature. Valmiki is revered as the first poet, or Adi Kavi, and the Ramayana, the first kavya.
His first disciples to whom he taught the Ramayana were Kusa and Lava, the sons of Rama